Closed ankur-kunaico closed 1 year ago
Interesting 🤔 This is probably due to the fact that I'm mapping over the children and passing them a custom key for AnimatePresence
to work properly.
Can you try to put the FocusTrap
between Sheet
and SheetContainer
? I'm doing that in my A11ySheet demo and worked okay.
const Example = () => {
return (
<Sheet>
<FocusTrap>
<SheetContainer>
/* ...content... */
</SheetContainer>
</FocusTrap>
</Sheet>
);
}
@Temzasse I'm using your A11ySheet
example but got the same issue.. but removing restoreFocus
"fixes" it. Any idea what the culprit could be?
EDIT Just realized FocusScope
is from another library https://github.com/adobe/react-spectrum.
Using it with FocusTrap
Without Focus Trap Its working as expected![ezgif com-gif-maker](https://user-images.githubusercontent.com/98843048/152906923-c1f4e9f8-cb32-4f57-aa39-5d471faffa9b.gif)