-
Notifications
You must be signed in to change notification settings - Fork 293
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
UI: Modals no longer update while closing #817
Conversation
This looks like a good approach. I have verified that it displays appropriately with Corp UIs. This prevents double clicking on buttons, but it is still possible to double trigger a button with keyboard controls. I have checked the 21 occurrences of if (event.key === KEY.ENTER) to see if they have some error checking to prevent this.
and there may be others that are keyboard-controllable without an explicit event handler. |
Good catch on the keyboard thing. I think css property |
@jjclark1982 I changed it to use |
@Snarling is
|
With the weird workaround (sending empty string instead of true, and undefined/null instead of false), inert should work for any base html element component, and it would probably work on any component that accepts general html attributes. I'm not a fan of the global type override. Not having the type override means that in order to use it, you must call it out as being abnormal usage by using a ts-ignore or ts-expect-error, where with the global type override you can do the jank workaround somewhere without making a comment about it. If we're going to do something confusing like sending empty string as the truthy value for a boolean html attribute, I think it's better if every usage of that is marked as being abnormal. |
Cool, that works.
I think I understand, and probably there are details I don't understand, consequences of one and the other. Semi-related - is there a reason BB hasn't updated to React 18? I found updating to 18 as a solution for a dev-mode console error (about aria labels, maybe you've encountered the same), which alone is inconsequential. But we also use Other changes seem irrelevant, and again there are details I'll miss, but is update to React 18 worthwhile? facebook/react#24195 |
IIRC React 18 was blocked on MUI, which requires some significant work to upgrade. But I could be mistaken. |
Sounds like that might be fixed with newer versions of MUI, pretty active topic - https://stackoverflow.com/questions/71713111/material-ui-installation-doesnt-work-with-react-18 |
The issue is that there's a lot we would have to change to upgrade to mui 5. It's not a simple package update, it's would be a very extensive refactor. So as with most things, the bottleneck is developers' time and interest. |
Modals were previously updating their contents and were still interactive during the closing animation, allowing e.g. a button that closes the modal to be pressed twice. This PR should fix both of these issues across all modals.
Tested alongside #782 which has some good example modals where it's clear the content is changing after the closing animation starts.
I temporarily set the transition time to 2 full seconds for this test, so it is more clear that the content does not update while the modal is closing. I also removed the special code from that PR that was instant-closing the modal.
Modal transitions were not actually changed to be this slow, the slowness was just a temporary change to make it easier to see that this was working properly.
2023-09-19.19-12-57.mp4