Fixes to issues with Dialog, FocusTrap, and StackContextProvider

* StackContextProvider had some reactivity that didn't make sense and would cause an infinite loop if it ever triggered.
* FocusTrap and Dialog did not work together properly all of the time. A top-level <Dialog> with initial state of closed would not have the FocusTrap triggered correctly when it was opened. Needed to make it reactive to changes in `containers`
This commit is contained in:
Ryan Gossiaux
2021-12-26 16:28:37 -08:00
parent 10f2eab08d
commit a2745e1770
3 changed files with 12 additions and 14 deletions

View File

@@ -253,10 +253,11 @@
onUpdate={(message, element) => {
return match(message, {
[StackMessage.Add]() {
containers.add(element);
containers = new Set([...containers, element]);
},
[StackMessage.Remove]() {
containers.delete(element);
containers = new Set([...containers]);
},
});
}}