Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e686c89 commit 3294c5aCopy full SHA for 3294c5a
packages/coreui-react/src/components/modal/CModal.tsx
@@ -133,6 +133,10 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
133
activeElementRef.current = document.activeElement as HTMLElement | null
134
document.addEventListener('mouseup', handleClickOutside)
135
document.addEventListener('keydown', handleKeyDown)
136
+ } else {
137
+ if (activeElementRef.current) {
138
+ activeElementRef.current.focus()
139
+ }
140
}
141
142
return () => {
@@ -148,10 +152,6 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
148
152
149
153
setVisible(false)
150
154
151
- if (activeElementRef.current) {
- activeElementRef.current.focus()
- }
-
155
return onClose && onClose()
156
157
0 commit comments