Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jalal246 committed Nov 3, 2023
1 parent 3601461 commit 94a92cc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
10 changes: 8 additions & 2 deletions packages/dflex-dnd/src/LayoutManager/DFlexDnDStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,7 @@ class DFlexDnDStore extends DFlexBaseStore {
}

private _reconcileSiblings(SK: string, syncAllSiblings: boolean): void {
const container = this.containers.get(SK)!;
const scroll = this.scrolls.get(SK)!;
const [container, scroll] = this.getContainers(SK);

if (__DEV__) {
if (!container) {
Expand Down Expand Up @@ -924,6 +923,13 @@ class DFlexDnDStore extends DFlexBaseStore {
return undefined;
}

getContainers(SK: string): [DFlexParentContainer, DFlexScrollContainer] {
const container = this.containers.get(SK)!;
const scroll = this.scrolls.get(SK)!;

return [container, scroll];
}

cleanupSiblingsAttachments(BK: string, SK: string, depth: number): void {
const scroll = this.scrolls.get(SK)!;

Expand Down
9 changes: 4 additions & 5 deletions packages/dflex-dnd/src/Mechanism/DFlexMechanismController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -877,10 +877,7 @@ class DFlexMechanismController extends DFlexScrollableElement {
return false;
}

const { containers, scrolls } = store;

const container = containers.get(SK)!;
const scroll = scrolls.get(SK)!;
const [container, scroll] = store.getContainers(SK)!;

const viewportRect = container.getBoundaries();

Expand Down Expand Up @@ -944,7 +941,9 @@ class DFlexMechanismController extends DFlexScrollableElement {

let isOutSiblingsContainer = false;

if (this._processScroll(x, y, SK)) {
const isHandledByScroll = this._processScroll(x, y, SK);

if (isHandledByScroll) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,13 @@ DFlexDnDStore {
"top": 0,
"width": 0,
},
"_siblingBoundaries": BoxNum {
"_siblingBoundaries": BoxRect {
"bottom": 0,
"height": 0,
"left": 0,
"right": 0,
"top": 0,
"width": 0,
},
"grid": PointNum {
"x": 0,
Expand Down Expand Up @@ -142,11 +144,13 @@ DFlexDnDStore {
"top": 0,
"width": 0,
},
"_siblingBoundaries": BoxNum {
"_siblingBoundaries": BoxRect {
"bottom": 0,
"height": 0,
"left": 0,
"right": 0,
"top": 0,
"width": 0,
},
"grid": PointNum {
"x": 0,
Expand Down

0 comments on commit 94a92cc

Please sign in to comment.