Create KeyItem struct for send_keys#79
Conversation
Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
madsmtm
left a comment
There was a problem hiding this comment.
Thanks for the PR!
- Separates
dispatch_typableandclearfunction fromKeyInputState- Return
KeyIteminstead ofKeyboardEventso we get can raw char and can convert it to action objects fordispatch actions.
It would make it easier for me to review this if you could split it into two PRs?
Also, could you add a test that breaks with the old behaviour, but works with the new? That'd make it easier for me to understand the change.
| Keyboard(KeyboardEvent), | ||
| Keyboard(KeyItem), |
There was a problem hiding this comment.
Hmm, I'd like to avoid this breaking change. Why can you not use the character in KeyboardEvent::key's Key::Character(...) variant?
There was a problem hiding this comment.
My concern is that we can't get the raw character for Key::Named. Much smaller changes is maybe to simply add raw_char on the KeyboardEvent. Do you think we should do that instead?
This change does not exactly fix behaviour for this crate, but it makes it simpler for user like web engine to implement Webdriver Element Send Keys command based on spec.
|
Returning back to this: I'm actually somewhat inclined to remove the |
Modify behaviour of send_keys:
dispatch_typableandclearfunction fromKeyInputStateKeyIteminstead ofKeyboardEventso we get can raw char and can convert it to action objects fordispatch actions.Note that on spec, we should not immediately dispatch the event. Rather we should went through dispatch action steps.
Fixes #78.