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

What level of simulation should be in Keyboard interactor? #186

Open
wKich opened this issue Feb 18, 2022 · 1 comment
Open

What level of simulation should be in Keyboard interactor? #186

wKich opened this issue Feb 18, 2022 · 1 comment
Labels
question Further information is requested

Comments

@wKich
Copy link
Member

wKich commented Feb 18, 2022

For the this moment Keyboard interactor allows to type some characters and simulates keyDown and keyUp events for the most possible keys. But there might be different scenarios where Keyboard interactor doesn't work well or doesn't support at all. For example:

  • Using functional keys, like Home/End/Arrows to move the cursor in a text field to later insert some text. Should Keyboard interactor be responsible for the selectionRage or not?
  • Using Enter for submitting a form if it is on a page.
  • Removing characters from a field by using Backspace/Delete keys.
  • Using PageUp/Down for the scrolling a page.
  • Supporting case with testing clipboard logic, like user selects a part of the text on page, hits Ctrl+C and then pastes it somewhere. Should it be specific Clipboard interactor for it?
  • Changing the focus by the Tab.

I mean all cases that supported by a browser in the native way, when you don't need a specific onKeyDown handler.

@wKich wKich added the question Further information is requested label Feb 18, 2022
@cowboyd
Copy link
Member

cowboyd commented Mar 2, 2022

@wKich I think we want to support all of these cases, but I think we need to split up each one by order of difficulty. Right now with simulated keyboard events there is no default action at all because browsers never fire default actions for synthetic events. What we're talking about though is providing not only the simulated events, but also the default actions for those events which is the next level of simulation.

It would almost be like partially implementing our own user agent and the activation triggers for them.

https://w3c.github.io/uievents/#event-types-list

This might actually be simpler in the long run since it has things like the "default action" of pressing keydown is to fire the beforeInput and input events for example.

I'd vote for Enter and Tab behaviors as being the most important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants