setAttribute being applied to parent
See original GitHub issueI have the following code
div(classes = setOf("alert", "alert-dismissible")) {
maxWidth = 20.rem
button(text = "×", classes = setOf("close")) {
setAttribute("data-dismiss", "alert")
}
}
}
which I’m expecting to add a data-dismiss attribute to the button, but is actually being applied to the parent div.
Is this correct behaviour? Is it possible to achieve without wrapping the button in another div?
Many Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
jquery - How do I set a the attribute of a parent element to be ...
It's a fairly odd situation because my google skills have completely failed me, and I know the solution is probably so simple to...
Read more >Element.setAttribute() - Web APIs | MDN
setAttribute () Sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a...
Read more >Setting attribute in editingDowncast or getting parent element ...
I need to apply attribute proporcja to element based on parent element. Down there is my code. Problem is that this attribute is...
Read more >Get Attribute of a Parent Node using JavaScript | bobbyhadz
To get an attribute of a parent node, select the child element and use the `parentElement` property to get access to the parent...
Read more >Reflect JavaScript Properties to HTML Attributes
This example exposes title as a public property. It converts the title to uppercase and uses the property privateTitle to hold the computed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve commited support for custom attributes for the
Component
interface and theWidget
class, so it will be available for all KVision components.Sorry for the late answer but I had to earn some money for my life, and had little time for other things 😉 Now I’m getting ready for KVision and the new release will be very soon.