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

tab not catched to move across controls #33

Open
stefanoborini opened this issue Jul 3, 2023 · 2 comments
Open

tab not catched to move across controls #33

stefanoborini opened this issue Jul 3, 2023 · 2 comments

Comments

@stefanoborini
Copy link

In general, if you press tab, you are going to move to the next control in the UI. However, this does not happen with shinyMatrix. If the matrix is not focused, you can't focus it pressing tab from a previous control. If the matrix is focused, you can't leave it by pressing tab.

The expected behavior is to be able to focus in and focus out using tab, and therefore triggering store of the changed data on focus out (as if you were clicking outside with the mouse)

@aneudecker
Copy link
Collaborator

Hi @stefanoborini,

thanks for using our package and reporting this behaviour. The use of tab is a bit overloaded, because we also use it to navigate between columns in the matrix. You would probably expect this behaviour:

  • Tabbing from outside into matrix: Set focus to the cell at the top-left
  • Tabbing inside the matrix (except last column): Move to the next column
  • Tabbing from the last column: Set focus to the next element on the page
  • Tabbing backwards inside the matrix (except first column): Move to previous column
  • Tabbing backwards from the first column: Set focus on the previous element on the page

We could implement this at some point

@stefanoborini
Copy link
Author

It's probably better to keep the cursor keys for column and row change, at least in browse mode.

In insert mode (when editing a column), enter should be mapped to store value and go next row, and the same for arrow up and down. The left and right of course cannot be mapped as such, because in insert mode you want to be able to move the cursor on the edited content.

I am not sure about the HIG for something like this on Microsoft excel and equivalents. If there's something like this, it's always a safer option to imitate what they have done, because it becomes more or less the accepted standard behavior for a matrix-like control.

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

No branches or pull requests

2 participants