mic
KPCKevin Powell - Community
•Created by mic on 3/24/2025 in #front-end
drag and drop but my text is in the way
I have a webapp where I list a bunch of items, and I decided to make the list drag and drop enabled, but when I try dragging the text gets selected and the drag event doesn't fire unless I already have selected text. How would I make the element drag instead of select the internal text? I tried
stopPropagation()
and it did nothing, same with preventDefault()
The project itself is in svelte, but I added here an ugly rudimentary recreation of this part in vanilla js in a codepen, any help at all is appreciated
https://codepen.io/mbaklor/pen/EaxRder?editors=101168 replies
KPCKevin Powell - Community
•Created by mic on 1/29/2025 in #front-end
Multi-input setup for license key
I'm making an "activate license" screen with an input for the license key, the license key itself is 5 sets of 6 characters separated by dashes.
I'd like to style it as a series of inputs where each segment is written, with the dashes already built in, and focus moving between the segments as you type or delete, and a paste of the license key fills the inputs and ignores the pasted dashes. Does that make sense as a method? Should I do it in one input but style it to look like many? Is there a secret third option I'm missing? How would I even implement it?
I'm currently running with svelte but I feel like this would require some vanilla js dom manipulation
42 replies