Adds edge scroll functionality for drag interactions
Implements EdgeScrollManager to enable automatic scrolling during drag operations Introduces new scroll management system that: - Detects mouse proximity to container edges - Provides variable scroll speed based on mouse position - Compensates dragged elements during scrolling Enhances drag-and-drop user experience with smooth scrolling
This commit is contained in:
parent
8b95f2735f
commit
10d8a444d8
5 changed files with 219 additions and 2 deletions
|
|
@ -8,6 +8,7 @@ import { IndexedDBContext } from '../storage/IndexedDBContext';
|
|||
import { DataSeeder } from '../workers/DataSeeder';
|
||||
import { ViewConfig } from '../core/ViewConfig';
|
||||
import { DragDropManager } from '../managers/DragDropManager';
|
||||
import { EdgeScrollManager } from '../managers/EdgeScrollManager';
|
||||
|
||||
export class DemoApp {
|
||||
private animator!: NavigationAnimator;
|
||||
|
|
@ -23,7 +24,8 @@ export class DemoApp {
|
|||
private headerDrawerManager: HeaderDrawerManager,
|
||||
private indexedDBContext: IndexedDBContext,
|
||||
private dataSeeder: DataSeeder,
|
||||
private dragDropManager: DragDropManager
|
||||
private dragDropManager: DragDropManager,
|
||||
private edgeScrollManager: EdgeScrollManager
|
||||
) {}
|
||||
|
||||
async init(): Promise<void> {
|
||||
|
|
@ -55,6 +57,10 @@ export class DemoApp {
|
|||
// Init drag-drop
|
||||
this.dragDropManager.init(this.container);
|
||||
|
||||
// Init edge scroll
|
||||
const scrollableContent = this.container.querySelector('swp-scrollable-content') as HTMLElement;
|
||||
this.edgeScrollManager.init(scrollableContent);
|
||||
|
||||
// Setup event handlers
|
||||
this.setupNavigation();
|
||||
this.setupDrawerToggle();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue