ui-components
ui-components copied to clipboard
Screen behind modal should not scroll when modal is open
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
~~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
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();
}