Closed (fixed)
Project:
Entity Browser
Version:
8.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 May 2019 at 15:08 UTC
Updated:
21 Oct 2024 at 00:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
oknate+1 on this! I was noticing this this morning. This would be great to fix. I suspect it has something to do with the ajax update of the underlying element. It loses the focus because the element it was focused on was removed.
Comment #3
sasanikolic commentedI also believe that for accessibility reasons, we should return the focus to the element that was focused before the entity browser modal was opened:
- Before opening the modal, save a reference to document.activeElement. After closing the modal, focus the reference to the previous activeElement.
Comment #4
sasanikolic commentedI did some debugging here, but could not find a triggering element in the event object of the dialogopen/beforecreate functions.
I also tried to have a click event listener on edit/change buttons, but that also didn't work as expected. Any idea where to write a fix for that @oknate?
Comment #5
sasanikolic commentedEDIT: sorry for the doublepost.
Comment #6
sasanikolic commentedComment #7
sasanikolic commentedThis is a patch with a workaround, that disables the focus on the "Save" button. With that at least the page doesn't jump after saving.
Tried adding the test, but unfortunately it seems that there's no way to check for focused elements in a js test?
Got this error:
Comment #8
sasanikolic commentedWrong line. Fixed it here.
Also, created a core issue for d.o. and added a patch there.
Comment #9
sasanikolic commentedComment #10
renrhafThanks sasanikolic for the patch. We noticed this issue in our project, then applied this patch and noted that the focus was no more set to the bottom of the form which is great for us ! Setting this to RTBC.
Comment #13
oknateCommitted, thanks!
🎉