ui-components icon indicating copy to clipboard operation
ui-components copied to clipboard

Screen behind modal should not scroll when modal is open

Open twjeffery opened this issue 10 months ago • 2 comments

Acceptance Criteria:

  • when Modal is open, screen should not be able to scroll behind the modal

Considerations

  • could use htmlElement: inert property? Discuss with @chrisolsen
  • Drawer component appears to be working correctly

twjeffery avatar May 08 '25 20:05 twjeffery

~~In theory, we should be able to add an inert: true to the document.body (easily referenced within component) when the modal is opened as well as set a inert: false at the root of the modal to override that value from that point in the DOM tree and down. On close of the modal the attribute is toggles/removed in the document.body.~~

This was tested and does not work

chrisolsen avatar May 09 '25 16:05 chrisolsen

A snippet of code was previously removed by your truly and I am assuming that at the time the update method was being called thereby removing the need for the code that was removed. So to start the code below can be re-added.

~line 58 no-scroll.ts

if (opts.enable) {
    hideScrollbars();
  }

chrisolsen avatar Aug 28 '25 20:08 chrisolsen