Skip to content

Modal: scroll disappears when backdrop="false" #224

Closed
@tturbs

Description

@tturbs
  • Operating system and version (Windows, macOS, Android, iOS) - macOS
  • Browser and version (Chrome, Firefox, Safari, Microsoft Edge, Opera, Android Browser) - chrome 136.0.7103.114
  • A reduced test case or suggested fix using CodePen or JS Bin
<button [cModalToggle]="myModal.id" cButton>
<c-modal id="myModal" #myModal [backdrop]="false" alignment="center">
  <c-modal-footer>
    <button [cModalToggle]="myModal.id" cButton color="secondary">close</button>
  </c-modal-footer>
</c-modal>

When the c-modal is activated and then closed using the close button, the body scroll disappears.

This issue occurs because the BackdropService calls hideScrollbar() but does not call resetScrollbar(). While hideScrollbar() is triggered during the animation regardless of whether backdrop="false" is set, resetScrollbar() is not.

This behavior needs to be fixed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions