Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Regression - Add account / Send modals, cursor not auto-focused input on opening #1588

Closed
Arnaud97234 opened this issue Oct 17, 2018 · 4 comments
Labels
bug Oops, this is a bug

Comments

@Arnaud97234
Copy link
Contributor

Arnaud97234 commented Oct 17, 2018

Bug found
ledger-live-desktop develop branch.
When add account or Send modals opens, the cursor is not focused on the input by default.

How to reproduce
Click add account button in the sidebar menu.
screen shot 2018-10-17 at 11 53 01

Expected behaviour
Cursor should be in input when modals opens.
screen shot 2018-10-17 at 11 54 05

@meriadec meriadec added the bug Oops, this is a bug label Oct 17, 2018
@gre gre mentioned this issue Oct 17, 2018
@juan-cortes
Copy link
Contributor

juan-cortes commented Oct 17, 2018

By running document.activeElement on both screens we see that the autoselect is not propagating down into the input itself but rather staying in the modal Wrapper. This appears to come from Moldal/index.js line 186, where we call domWrapper.focus()

This comes from a commit from @meriadec 642e72e but it's from back in June. I played with having that line removed and I couldn't find any odd behaviour, surely enough we get the autofocus back into the currency/recipient.

If you say it's ok to remove it I have a PR ready to request.

@meriadec
Copy link
Member

Hmm I see, so the modal wrapper focus take back the focus from the input.
That's annoying because this domWrapper.focus() was intended, to make keyboard navigation natural (when you open a modal, then press <TAB>, you want the first tabbable element to be focused, so the modal need to gain focus).

Instead of removing, we may want to add prop to Modal to prevent tihs behaviour in some cases.

The fact that autofocus was correctly working until here is only due to luck 😄

@juan-cortes
Copy link
Contributor

I'll look into it, should be simple enough

@meriadec
Copy link
Member

fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Oops, this is a bug
Projects
None yet
Development

No branches or pull requests

3 participants