Skip to content

Commit 50e44a5

Browse files
committed
scroll containers on drag
1 parent 10dfe1c commit 50e44a5

File tree

7 files changed

+20
-18
lines changed

7 files changed

+20
-18
lines changed

apps/web-widgets/drag-and-drop-widget/Example_1.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
### [Live Demo](https://dnd-lts-sandbox.mxapps.io/p/example_1?profile=Responsive)
44

55
To show how to use the widget I will be using the examples in the test project. You can find the Example Project
6-
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.0/dnd_lts.mpk) or
6+
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.2/dnd_lts.mpk) or
77
if you only want the Helpers
8-
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.0/DnD_HelpersModule.mpk)
8+
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.2/DnD_HelpersModule.mpk)
99
and the Examples
10-
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.0/DnD_Examples.mpk)
10+
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.2/DnD_Examples.mpk)
1111

1212
Get a ☕️ and lets go...
1313

apps/web-widgets/drag-and-drop-widget/Example_2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
### [Live Demo](https://dnd-lts-sandbox.mxapps.io/p/example_2?profile=Responsive)
44

55
To show how to use the widget I will be using the examples in the test project. You can find the Example Project
6-
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.0/dnd_lts.mpk) or
6+
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.2/dnd_lts.mpk) or
77
if you only want the Helpers
8-
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.0/DnD_HelpersModule.mpk)
8+
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.2/DnD_HelpersModule.mpk)
99
and the Examples
10-
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.0/DnD_Examples.mpk)
10+
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.2/DnD_Examples.mpk)
1111

1212
Get a ☕️ and lets go...
1313

apps/web-widgets/drag-and-drop-widget/Example_3.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
### [Live Demo](https://dnd-lts-sandbox.mxapps.io/p/example_3?profile=Responsive)
44

55
To show how to use the widget I will be using the examples in the test project. You can find the Example Project
6-
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.0/dnd_lts.mpk) or
6+
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.2/dnd_lts.mpk) or
77
if you only want the Helpers
8-
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.0/DnD_HelpersModule.mpk)
8+
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.2/DnD_HelpersModule.mpk)
99
and the Examples
10-
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.0/DnD_Examples.mpk)
10+
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.2/DnD_Examples.mpk)
1111

1212
Get a ☕️ and lets go...
1313

apps/web-widgets/drag-and-drop-widget/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ We have a playable Demo [here](https://dnd-lts-sandbox.mxapps.io/index.html?prof
2222
## How to use the Widget via examples
2323

2424
To show how to use the widget I will be using the examples in the test project. You can find the Example Project
25-
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.0/dnd_lts.mpk) or
25+
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.2/dnd_lts.mpk) or
2626
if you only want the Helpers
27-
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.0/DnD_HelpersModule.mpk)
27+
[here](https://github.com/mendixlabs/app-services-components/releases/download/draganddropwidget%403.0.2/DnD_HelpersModule.mpk)
2828
and the Examples [here](https://dnd-lts-sandbox.mxapps.io/p/example_1?profile=Responsive)
2929

3030
## Examples

apps/web-widgets/drag-and-drop-widget/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "draganddropwidget",
33
"widgetName": "Draganddropwidget",
4-
"version": "3.0.1",
4+
"version": "3.0.2",
55
"description": "My widget description",
66
"copyright": "2022 Mendix Technology BV",
77
"author": "ahwelgemoed",

apps/web-widgets/drag-and-drop-widget/src/Draganddropwidget.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,17 @@ const DndWidget: FunctionComponent<DraganddropwidgetContainerProps> = props => {
3838
const [isOverIndex, setIsOverIndex] = useState<null | number>(null);
3939

4040
/**
41-
* We give a Child comp a way to get its parents parent. NOTE: This will only ever work 2n
41+
* We give a Child comp a way to get its parents parent. NOTE: This will only ever work 2n and does not recalculate on Window resize
4242
*/
4343
useEffect(() => {
4444
if (uuidParent) {
4545
const myParent = document.querySelectorAll(`[data-uuid="${uuidParent}"]`);
46-
// @ts-ignore
47-
const containerName = myParent[0] && myParent[0].attributes["data-containing-uuid"].value;
48-
if (containerName) {
49-
parentContainerName.current = document.getElementById(containerName) as HTMLDivElement;
46+
if (myParent.length) {
47+
// @ts-ignore
48+
const containerName = myParent[0]?.attributes["data-containing-uuid"].value;
49+
if (containerName) {
50+
parentContainerName.current = document.getElementById(containerName) as HTMLDivElement;
51+
}
5052
}
5153
}
5254
}, [uuidParent]);

apps/web-widgets/drag-and-drop-widget/src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="Draganddropwidget" version="3.0.1" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="Draganddropwidget" version="3.0.2" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="Draganddropwidget.xml"/>
66
</widgetFiles>

0 commit comments

Comments
 (0)