File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import Swipe from './util/swipe.js'
1212import { enableDismissTrigger } from './util/component-functions.js'
1313import {
1414 isDisabled ,
15+ isRTL ,
1516 isVisible
1617} from './util/index.js'
1718
@@ -114,20 +115,17 @@ class Drawer extends DialogBase {
114115 swipeConfig . upCallback = ( ) => this . hide ( )
115116 } else if ( element . classList . contains ( 'drawer-end' ) ) {
116117 // RTL: swipe left to dismiss end drawer
117- const isRtl = document . documentElement . dir === 'rtl'
118- if ( isRtl ) {
118+ if ( isRTL ( ) ) {
119119 swipeConfig . leftCallback = ( ) => this . hide ( )
120120 } else {
121121 swipeConfig . rightCallback = ( ) => this . hide ( )
122122 }
123+ } else if ( isRTL ( ) ) {
124+ // drawer-start (default): swipe right to dismiss in RTL
125+ swipeConfig . rightCallback = ( ) => this . hide ( )
123126 } else {
124127 // drawer-start (default): swipe left to dismiss in LTR
125- const isRtl = document . documentElement . dir === 'rtl'
126- if ( isRtl ) {
127- swipeConfig . rightCallback = ( ) => this . hide ( )
128- } else {
129- swipeConfig . leftCallback = ( ) => this . hide ( )
130- }
128+ swipeConfig . leftCallback = ( ) => this . hide ( )
131129 }
132130
133131 this . _swipeHelper = new Swipe ( element , swipeConfig )
You can’t perform that action at this time.
0 commit comments