Skip to content

bug: JANKY animation on closing modal (with proposed fix)ย #3946

@thednp

Description

@thednp

Reproduction URL (Required)

https://daisyui.com/components/modal/

What version of daisyUI are you using?

5.0.43

Which browsers are you seeing the problem on?

Chrome

Describe your issue

When you close a modal, you always get a JANKY animation (the dialog jumps left about 15px, the exact size of a scrollbar), which is horrible UX.

THE DEFINITIVE FIX:

instead of using

.modal {
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior: contain;
}

you can instead do this

.modal {
  scrollbar-gutter: auto;
  overscroll-behavior: contain; /* this should be optional IMO, but I don't know what this tries to fix/cover */
}

scroll-gutter: auto; should fix any and all JANKY behaviours with popups and such. Try it let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions