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:
@@ -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]);
|
||||
},
|
||||
});
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user