Timeline for How do I add and remove classes using event listeners in Lit-HTML?
Current License: CC BY-SA 4.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 26, 2019 at 16:35 | comment | added | Christian S. | Yes, they are a bit behind on documentation at the moment sadly. | |
Jan 25, 2019 at 17:19 | vote | accept | Sumomo | ||
Jan 25, 2019 at 17:19 | comment | added | Sumomo | Cheers! classMap was what I was looking for, seems made for the job :) Nothing in the docs, but the comments in the source code explain github.com/Polymer/lit-html/blob/master/src/directives/… | |
Jan 24, 2019 at 19:25 | comment | added | Christian S. | Added some more clarification | |
Jan 24, 2019 at 18:42 | history | edited | Christian S. | CC BY-SA 4.0 |
added 408 characters in body
|
Jan 24, 2019 at 9:30 | comment | added | Sumomo | Thanks for the update, but it is only a partial answer, you did not address the CSS or what the dragEnter() method might contain. I am new to lit-html and the docs are woefully inadequate right now (it is pre-release still). What is best practice? Should my methods mutate the DOM as before? Should I feed in new variables into the template/re-write it with new bindings for class? Run the render() function again after each callback? If you could provide a full solution in code would be great :) Thanks for your time, it is much appreciated! | |
Jan 24, 2019 at 6:32 | comment | added | Christian S. | Updated the answer based on your comment. | |
Jan 24, 2019 at 6:32 | history | edited | Christian S. | CC BY-SA 4.0 |
added clarification based on comment
|
Jan 23, 2019 at 22:11 | comment | added | Sumomo |
I don't have any custom elements, I am using lit-html by itself, not with lit-element or some equivalent. I am not sure how your code relates to the CSS, are you saying I have to use a callback to this.dragEnter , if so, what would be in that method, how will it refer to the <button>? Cheers!
|
|
Jan 23, 2019 at 21:13 | history | answered | Christian S. | CC BY-SA 4.0 |