1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-26 06:44:35 +02:00

Always modal scroll top to 0

This commit is contained in:
ysds
2020-03-04 23:51:15 +09:00
committed by XhmikosR
parent 05fb3905e6
commit dfa017adc3
2 changed files with 23 additions and 25 deletions

View File

@@ -60,7 +60,6 @@ const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY}`
const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
const CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable'
const CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure'
const CLASS_NAME_BACKDROP = 'modal-backdrop'
const CLASS_NAME_OPEN = 'modal-open'
@@ -249,11 +248,10 @@ class Modal {
this._element.style.display = 'block'
this._element.removeAttribute('aria-hidden')
this._element.setAttribute('aria-modal', true)
this._element.scrollTop = 0
if (this._dialog.classList.contains(CLASS_NAME_SCROLLABLE) && modalBody) {
if (modalBody) {
modalBody.scrollTop = 0
} else {
this._element.scrollTop = 0
}
if (transition) {