How to globally disabled scrolling when a modal is open

3 posts, 1 answers
  1. Patrick
    Patrick avatar
    5 posts
    Member since:
    Mar 2015

    Posted 07 May 2019 Link to this post

    Hi,

    When opening a <kendo-dialog> the background is still scrolling.

    The work around I found is to set the <body> with an overflow:hidden.

    But how to automate this generally for all my modals?

    Since this is a modal, I think the kendo-dialog should be disabling the body scrolling.

    Any workaround to fix this?

    Thanks.

     

  2. Answer
    Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    1263 posts

    Posted 08 May 2019 Link to this post

    Hello Patrick,

    You are correct - the modal nature of the Dialog suggests that the page should not be scrollable when the Dialog is opened. This is why we have logged an enhancement item to our GitHub repository that you can track here:

    https://github.com/telerik/kendo-angular/issues/786

    Our developers and UX specialists will discuss this topic, and we will consider adding this enhancement, based on their assessment. Meanwhile, you can utilize the workaround outlined in the GitHub thread, e.g.:

    https://stackblitz.com/edit/angular-g2clgx?file=app/app.component.ts

    I hope this helps.

    Regards,
    Dimiter Topalov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.

  3. Patrick
    Patrick avatar
    5 posts
    Member since:
    Mar 2015

    Posted 08 May 2019 in reply to Dimiter Topalov Link to this post

    Thank you for the quick response Dimiter.

    The workaround works great!

Back to Top