manifold
manifold copied to clipboard
Closing an Admin Interface Listbox Contained in an Edit Modal Attempts to Close the Modal
In the Admin Interface, a lot of Editing happens in a modal on the side of the screen. If there is a Listbox contained in that modal, attempting to close the Listbox instead attempts to close the whole modal, which causes confusion and could potentially lead to accidental deletion of edits.
Expected Behavior
Closing an expanded Listbox should close the Listbox and place focus back on the button that opened that opened it.
Current Behavior
Closing certain Listboxes in the Admin Interface opens an unrelated popup modal, causing confusion.
Steps to Reproduce
- Navigate to Admin Interface (via Enter Admin Mode)
- Navigate to an editable project
- Navigate to the Layout page
- Edit the Calls to Action, and activate the "Add Button to Left Side" button
- Navigate to and activate the "type" Listbox
- Press the arrow down key to change the selected option
- Press escape to close the Listbox
- Notice how a new "Are you Sure" modal pops up (also note that "Are You Sure" is not announced, but this will be its own issue).
- Note how continually pressing escape continues to close and reopen this modal
Testing Environment
NVDA 2019.2.1 ESR Firefox 68.2.0 esr
Thanks for documenting this for us @Santoz2. I'm actually seeing four different issues when I review this:
- Pushing ESC with the listbox active triggers the drawer's keyup listener. I'm seeing this in Firefox and Safari, but not Chrome.
- The "Are you sure?" modal isn't announced.
- Pushing ESC in the "Are you sure?" modal triggers the drawer's keyup listener.
- The color of the listbox is black in Firefox. This likely can be traced to trying to set a color for the options, since FF is unique in inheriting this color from the
<select>
, and would otherwise appear white in this context.
I'm going to break these up and track them as separate issues.
No. 2 is tracked at #2430 No. 4 is tracked at #2429
Thank you for breaking these up!
@dananjohnson you need anything from me to close this one out?
@zdavis as far as I can tell, this issue was in mind when the Drawer component was initially built, but the attempted solution doesn't actually work. Specifically, <Drawer />
tries to use the Context API to pause keyboard events when a Dialog component is mounted. However, the the Dialog is higher up the tree than Drawer, so it can't actually be a consumer of the Drawer's context. Before jumping back into this, I wanted to check with you about how best to resolve this. It looks like the context provider would to be near the very top of the tree if it's going to be consumed by <Dialog />
.
Sidenote: I started by updating to the new Context API here, since the old API is now deprecated.
I don't really have a strong thought on this. Can you resolve it without my input, @dananjohnson, or do I need to dig into it?
@zdavis it's been awhile, so let me take a look again. I should be able to solve it.