Skip to content
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

fix: emit sl-change from checkbox on user interaction only #498

Merged

Conversation

bennypowers
Copy link
Contributor

fixes #497

@vercel
Copy link

vercel bot commented Aug 10, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/shoelace/shoelace/AV1K4r5QQYnaVRaNzpcJ7QZVS8Fk
✅ Preview: https://shoelace-git-fork-bennypowers-fix-checkbox-emit-414397-shoelace.vercel.app

@claviska
Copy link
Member

Nice catch, and thanks so much for the tests!

While we're looking at this, it probably makes sense to add the same logic to <sl-switch> and possibly <sl-radio>. Is that something you're interested in adding to this? (I'm happy to tackle it in the next day or two if you don't have the time.)

@bennypowers
Copy link
Contributor Author

sure i can grab that

@bennypowers bennypowers force-pushed the fix/checkbox-emit-on-user-action-only branch from 49ef09b to 9216e72 Compare August 10, 2021 16:43
@claviska claviska merged commit 2b12a47 into shoelace-style:next Aug 10, 2021
@claviska
Copy link
Member

Thanks again. I noticed <sl-switch> wasn't emitting sl-change using left/right arrows, so I fixed that and added a test. Unfortunately, I don't think I'm using sendKeys() right here because I couldn't get it to recognize the arrow keys.

3bb8614#diff-dc93b9977ec07e71d499241926223e79068a694b82e6c1b81664aefc28149917R38-R47

I don't have time to dig deeper at the moment so I commented it out. Maybe I'm using the wrong string, but I assumed it uses the same values as event.key.

@bennypowers
Copy link
Contributor Author

yeah that's def. the correct string. odd
https://playwright.dev/docs/api/class-keyboard#keyboard-down

@bennypowers bennypowers deleted the fix/checkbox-emit-on-user-action-only branch August 11, 2021 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setting checkbox.checked should not fire sl-change
2 participants