mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 10:57:04 +08:00
DEV: applies body-scroll-lock on select-kit (#26397)
This will prevent any scrolling issues with sk when on mobile, especially on iOS and in modals. Prior to this fix, scrolling could sometimes stop working in dropdowns.
This commit is contained in:
parent
e911362864
commit
2146ab492b
|
@ -1,5 +1,11 @@
|
|||
{{#if this.collection.content.length}}
|
||||
<ul class="select-kit-collection" aria-live="polite" role="menu">
|
||||
<ul
|
||||
class="select-kit-collection"
|
||||
aria-live="polite"
|
||||
role="menu"
|
||||
{{did-insert this.lock}}
|
||||
{{will-destroy this.unlock}}
|
||||
>
|
||||
{{#each this.collection.content as |item index|}}
|
||||
{{component
|
||||
(component-for-row this.collection.identifier item this.selectKit)
|
||||
|
|
|
@ -1,5 +1,20 @@
|
|||
import Component from "@ember/component";
|
||||
import { action } from "@ember/object";
|
||||
import {
|
||||
disableBodyScroll,
|
||||
enableBodyScroll,
|
||||
} from "discourse/lib/body-scroll-lock";
|
||||
|
||||
export default Component.extend({
|
||||
tagName: "",
|
||||
|
||||
@action
|
||||
lock(element) {
|
||||
disableBodyScroll(element);
|
||||
},
|
||||
|
||||
@action
|
||||
unlock(element) {
|
||||
enableBodyScroll(element);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user