mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-21 15:31:46 +01:00
feat(useOverlay): add isOpen method to check overlay state (#4041)
This commit is contained in:
@@ -122,6 +122,12 @@ function _useOverlay() {
|
||||
return overlay
|
||||
}
|
||||
|
||||
const isOpen = (id: symbol): boolean => {
|
||||
const overlay = getOverlay(id)
|
||||
|
||||
return overlay.isOpen
|
||||
}
|
||||
|
||||
return {
|
||||
overlays,
|
||||
open,
|
||||
@@ -129,7 +135,8 @@ function _useOverlay() {
|
||||
closeAll,
|
||||
create,
|
||||
patch,
|
||||
unMount
|
||||
unMount,
|
||||
isOpen
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user