🌐 AI搜索 & 代理 主页
Skip to content

Commit 59b4321

Browse files
authored
Update modal.js
1 parent 532a391 commit 59b4321

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/components/modal/modal.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ import { isBrowser } from '../../utils/env'
1414
import { isString, isUndefinedOrNull } from '../../utils/inspect'
1515
import { getComponentConfig } from '../../utils/config'
1616
import { stripTags } from '../../utils/html'
17-
import { contains, eventOff, eventOn, isVisible, select, selectAll, requestAF } from '../../utils/dom'
17+
import {
18+
contains,
19+
eventOff,
20+
eventOn,
21+
isVisible,
22+
requestAF,
23+
select,
24+
selectAll
25+
} from '../../utils/dom'
1826
import { BButton } from '../button/button'
1927
import { BButtonClose } from '../button/button-close'
2028

@@ -585,7 +593,10 @@ export const BModal = /*#__PURE__*/ Vue.extend({
585593
this.checkModalOverflow()
586594
this.isShow = true
587595
this.isTransitioning = false
588-
this.$nextTick(() => {
596+
// TODO: Switch this to requestAF to allow transition hooks to complete
597+
// before passing control over to the otehr handlers.
598+
// This will allow users to not have to use nextTick or requestAF
599+
requestAF(() => {
589600
this.emitEvent(this.buildEvent('shown'))
590601
this.setEnforceFocus(true)
591602
this.$nextTick(() => {
@@ -765,9 +776,7 @@ export const BModal = /*#__PURE__*/ Vue.extend({
765776
// Make sure top of modal is showing (if longer than the viewport)
766777
modal.scrollTop = 0
767778
}
768-
// DEBUG
769-
console.log('Auto Focus Element:', el)
770-
console.log('Focused:', attemptFocus(el))
779+
attemptFocus(el)
771780
}
772781
})
773782
}

0 commit comments

Comments
 (0)