File tree Expand file tree Collapse file tree 7 files changed +20
-18
lines changed
apps/web-widgets/drag-and-drop-widget Expand file tree Collapse file tree 7 files changed +20
-18
lines changed Original file line number Diff line number Diff line change 3
3
### [ Live Demo] ( https://dnd-lts-sandbox.mxapps.io/p/example_1?profile=Responsive )
4
4
5
5
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
7
7
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 )
9
9
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 )
11
11
12
12
Get a ☕️ and lets go...
13
13
Original file line number Diff line number Diff line change 3
3
### [ Live Demo] ( https://dnd-lts-sandbox.mxapps.io/p/example_2?profile=Responsive )
4
4
5
5
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
7
7
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 )
9
9
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 )
11
11
12
12
Get a ☕️ and lets go...
13
13
Original file line number Diff line number Diff line change 3
3
### [ Live Demo] ( https://dnd-lts-sandbox.mxapps.io/p/example_3?profile=Responsive )
4
4
5
5
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
7
7
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 )
9
9
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 )
11
11
12
12
Get a ☕️ and lets go...
13
13
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ We have a playable Demo [here](https://dnd-lts-sandbox.mxapps.io/index.html?prof
22
22
## How to use the Widget via examples
23
23
24
24
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
26
26
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 )
28
28
and the Examples [ here] ( https://dnd-lts-sandbox.mxapps.io/p/example_1?profile=Responsive )
29
29
30
30
## Examples
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " draganddropwidget" ,
3
3
"widgetName" : " Draganddropwidget" ,
4
- "version" : " 3.0.1 " ,
4
+ "version" : " 3.0.2 " ,
5
5
"description" : " My widget description" ,
6
6
"copyright" : " 2022 Mendix Technology BV" ,
7
7
"author" : " ahwelgemoed" ,
Original file line number Diff line number Diff line change @@ -38,15 +38,17 @@ const DndWidget: FunctionComponent<DraganddropwidgetContainerProps> = props => {
38
38
const [ isOverIndex , setIsOverIndex ] = useState < null | number > ( null ) ;
39
39
40
40
/**
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
42
42
*/
43
43
useEffect ( ( ) => {
44
44
if ( uuidParent ) {
45
45
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
+ }
50
52
}
51
53
}
52
54
} , [ uuidParent ] ) ;
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<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/" >
4
4
<widgetFiles >
5
5
<widgetFile path =" Draganddropwidget.xml" />
6
6
</widgetFiles >
You can’t perform that action at this time.
0 commit comments