-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing :options to attributes makes them appear in DOM #556
Comments
I will correct |
Corrected in version 2.19,1 |
@David-Desmaisons Hi, any way to apply some $attrs to the created element? I use a couple of custom attributes in development, |
You are correct @courcelan , with this correction, your scenario will be broken. Can you explain better why you pass attributes to the root element? |
Sure! The root element is the containing element and is needed for flex/grid/padding/etc. We use a variation of functional css and a system of attributes mapped to various media queries rather than overload the class attribute with what could be extremely lengthy declaration. I’ve gotten around the issue by making the root element very “dumb” and is in another containing element that uses the appropriate attributes. However this does call for extra unnecessary markup that would be better served by allowing general attributes to be placed on the root element. Thanks! |
You cab make the root element and pass props to it using componnetData props (see for example https://sortablejs.github.io/Vue.Draggable/#/third-party) |
I think this may have broken the id prop that is not getting set <Draggable the id="myId" dissapears from the object |
@jbayona89 you are correct, could you create a dedicated issue for id attribute, please? |
@David-Desmaisons Already done, #566 |
@courcelan starting with version 2.19,2 id and attribute starting with "data-" will be copied as attribute to the root element. This should address your scenario provided you named them "data-something" |
@David-Desmaisons great. thanks! |
For example, if you have this:
And looking at devtools, the html rendered ends up being this:
<div handle=".lobby" draggable="true" ghost-class="network-placeholder" group="networks" class="networks">
It doesn't sound like a particularly good idea to do this, perhaps valid options should be skipped from DOM if possible?
The text was updated successfully, but these errors were encountered: