-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Trouble setting onBeforeInput handler #688
Comments
According to https://stackoverflow.com/questions/68108411/react-how-to-use-event-data-in-onbeforeinput-handler-without-typescript-error, the event type differs between browsers, so I wonder if React is doing something funky to normalize events here. Regardless, Slinky doesn't do anything with events, it just passes them through, so not super sure what's going on here. |
How strange. I'll try this with React in JS and report back. Thanks!
…---
Sent with Superhuman ( https://superhuman.com/refer/cmsqjaxn ). Please favor brief email ( http://three.sentenc.es/ ) over chat, especially for tasks. For chat (+1-415-235-0687), WhatsApp is best. Never Signal unless there are legal issues.
On Mon, Dec 25, 2023 at 3:05 PM, Shadaj Laddad < ***@***.*** > wrote:
According to https:/ / stackoverflow. com/ questions/ 68108411/ react-how-to-use-event-data-in-onbeforeinput-handler-without-typescript-error
(
https://stackoverflow.com/questions/68108411/react-how-to-use-event-data-in-onbeforeinput-handler-without-typescript-error
) , the event type differs between browsers, so I wonder if React is doing
something funky to normalize events here. Regardless, Slinky doesn't do
anything with events, it just passes them through, so not super sure
what's going on here.
—
Reply to this email directly, view it on GitHub (
#688 (comment) ) , or
unsubscribe (
https://github.com/notifications/unsubscribe-auth/AAAOIXO2G5OEKWB4E6IDFR3YLIBD7AVCNFSM6AAAAABA4B5JVGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRZGE2DKOBTGE
).
You are receiving this because you authored the thread. Message ID: <shadaj/slinky/issues/688/1869145831
@ github. com>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd like to set an onBeforeInput handler on a content-editable div that I have. Since slinky.web.html doesn't contain an onBeforeInput subclass of Attr, I figured that I'd just make the AttrPair myself:
https://github.com/malcolmredheron/scalajs-slinky-beforeinput-event-type/blob/main/src/main/scala/testvite/Main.scala shows that if I handle onInput this way, or use addEventListener to handle "beforeinput" then in both cases I get the expected InputEvent.
Where is the InputEvent coming from? Is Slinky making it?
The text was updated successfully, but these errors were encountered: