Skip to content

Commit e0822ce

Browse files
committed
fix(QLayoutDrawer): RTL positioning when switching back and forth to a Quasar RTL language pack
1 parent 17276ae commit e0822ce

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

src/components/layout/QLayoutDrawer.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,15 @@ export default {
117117
if (this.mobileOpened || this.onScreenOverlay) {
118118
this.hide()
119119
}
120+
},
121+
rightSide () {
122+
this.applyPosition()
123+
},
124+
size () {
125+
this.applyPosition()
126+
},
127+
'$q.i18n.rtl' () {
128+
this.applyPosition()
120129
}
121130
},
122131
computed: {
@@ -283,6 +292,16 @@ export default {
283292
},
284293
methods: {
285294
applyPosition (position) {
295+
if (position === void 0) {
296+
this.$nextTick(() => {
297+
position = this.showing
298+
? 0
299+
: (this.$q.i18n.rtl ? -1 : 1) * (this.rightSide ? 1 : -1) * this.size
300+
301+
this.applyPosition(position)
302+
})
303+
return
304+
}
286305
css(this.$refs.content, cssTransform(`translateX(${position}px)`))
287306
},
288307
applyBackdrop (x) {

src/components/layout/QPageSticky.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ export default {
8080

8181
if (attach.vertical) {
8282
if (this.left) {
83-
css.left = `${this.left}px`
83+
css[this.$q.i18n.rtl ? 'right' : 'left'] = `${this.left}px`
8484
}
8585
if (this.right) {
86-
css.right = `${this.right}px`
86+
css[this.$q.i18n.rtl ? 'left' : 'right'] = `${this.right}px`
8787
}
8888
}
8989
else if (attach.horizontal) {

0 commit comments

Comments
 (0)