-
Notifications
You must be signed in to change notification settings - Fork 725
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
Focus inside input field on show show input modal #10789
Focus inside input field on show show input modal #10789
Conversation
@@ -1570,6 +1570,9 @@ L.Control.UIManager = L.Control.extend({ | |||
that.closeModal(dialogId); | |||
}} | |||
]); | |||
|
|||
// focus on input modal on show | |||
document.getElementById('input-modal-input').focus(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should try to avoid getElementById
where possible.
Also: why not put this inside showModal
function? then in all places where we show modal we will focus it, not only in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we have to, better to query inside container: container.querySelector('#id')
that makes us sure we will not get element from some other place than our current component/dialog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
73fe57e
to
512bb90
Compare
1276de9
to
1a69611
Compare
- fix regression caused by #10795 - need to handle both tabcontrol element and single init focus element Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com> Change-Id: I5a29ddf7b4562221fc8a6c574a775d2a2e9180a8
1a69611
to
49648c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks ok
can we have some cypress test which will check that initial focus? |
Change-Id: I5a29ddf7b4562221fc8a6c574a775d2a2e9180a8
Summary
TODO
Checklist
make prettier-write
and formatted the code.make check
make run
and manually verified that everything looks okay