Skip to content

modal with long content on click backdrop will scroll to .modal-content top #1748

Closed
@ganlvtech

Description

@ganlvtech

System Information

  • Windows 10
  • Google Chrome (64bit) 64.0.3282.186

Description

Test code can be found on CodePen. I have also run the test code on Edge and IE 11. There is nothing wrong on Edge. But on IE 11, it has the same problem.

When I click the backdrop and hold left mouse button down, the content will scroll to .modal-content 's top. As a result, the scrollTop attribute of .modal will change to 28px (or 1.75rem) from zero.

I found it may be caused by the onFocusout listener of .modal-content. I can set no-enforce-force to true to prevent this problem, but I don't know the reason why browsers behave differently.

Test script

<div id="app">
  <b-btn @click="show = true">Show modal</b-btn>
  <b-modal v-model="show">
    <p class="my-4">{{ content }}</p>
  </b-modal>
</div>
var app = new Vue({
  el: '#app',
  data: {
    show: false,
    content: 'A modal with ' + 'very '.repeat(500) + 'long content.'
  }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions