I'm developing a template in J!4 and using jQuery UI sortable. Please see screen capture.
https://monosnap.com/file/uEbLYVEqhLRMxyStGmSfg2zRX72iPJ
The switcher fields are inside modal, every time I move a sortable element and open the modal, the switcher field is duplicated. I move the element again, switcher will be triplicated and so on. That behavior only happened to the moved sortable element.
Switcher should not duplicate itself when the element container is moved.
Switcher field is duplicating itself by the how many times I move the container element.
Labels |
Added:
?
|
Build | staging | ⇒ | 4.0-dev |
Category | ⇒ | Templates (site) |
I'm developing a template in J!4 and using jQuery UI
Good luck with that
Now a serious answer:
A note on the last one
Custom elements have some lifecycle events which will be triggered on the appropriate event. It’s the same logic that vue, angular, react and every other modern js lib is using. The problem is that you try to use a dinosaur ? script with cutting edge technology and that obsiously doesn’t work pretty nice. I suspect the your script somehow triggers the connected callback (the element is inserted in the don) and that triggers all the logic that is bound to it in the custom element (eg create a new node)
Easy way out:
Use https://github.com/schne324/dragon-drop which is also fully accessible instead of the deprecated jquery ui
@C-Lodder Thanks for your suggestion, I actually created a modified version of subform field to create my layout field. Subform field does become convoluted when there are more fields and it does look confusing. I actually use it at first going to route of creating my own. It is good for just 2-3 subform fields but once you go over, not a good UI design.
Yes, jquery ui will not ship in j4
Status | New | ⇒ | Discussion |
@frogydiak Yes it will be removed in J4. That's what the PR I linked you to do. It converts the jQuery UI sortable feature to a custom element. Would be great if you can test as this is a pretty big/complex task so any feedback would be great.
@frogydiak can you please close this Issue?
Status | Discussion | ⇒ | Information Required |
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-02-02 14:50:30 |
Closed_By | ⇒ | brianteeman |
Closed
Changed Build from "staging" to "4.0-dev".
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19517.