Skip to content

Commit d4ab12c

Browse files
committed
fix(pickerheader): Reorder prev/next buttons when rtl
1 parent 628768d commit d4ab12c

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

src/components/PickerHeader.vue

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<header>
33
<span
44
class="prev"
5-
:class="{ disabled: isLeftNavDisabled }"
5+
:class="{ disabled: isPreviousDisabled, rtl: isRtl }"
66
@click="$emit('page-change', -1)"
77
>
88
<slot name="prevIntervalBtn">
@@ -12,7 +12,7 @@
1212
<slot />
1313
<span
1414
class="next"
15-
:class="{ disabled: isRightNavDisabled }"
15+
:class="{ disabled: isNextDisabled, rtl: isRtl }"
1616
@click="$emit('page-change', 1)"
1717
>
1818
<slot name="nextIntervalBtn">
@@ -39,23 +39,5 @@ export default {
3939
required: true,
4040
},
4141
},
42-
computed: {
43-
/**
44-
* Is the left hand navigation button disabled?
45-
* @return {Boolean}
46-
*/
47-
/* istanbul ignore next */
48-
isLeftNavDisabled() {
49-
return this.isRtl ? this.isNextDisabled : this.isPreviousDisabled
50-
},
51-
/**
52-
* Is the right hand navigation button disabled?
53-
* @return {Boolean}
54-
*/
55-
/* istanbul ignore next */
56-
isRightNavDisabled() {
57-
return this.isRtl ? this.isPreviousDisabled : this.isNextDisabled
58-
},
59-
},
6042
}
6143
</script>

src/styles/style.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,18 @@
3232
}
3333

3434
header {
35-
display: block;
35+
display: flex;
36+
justify-content: space-between;
3637
line-height: 40px;
3738

3839
span {
3940
display: inline-block;
40-
float: left;
4141
text-align: center;
4242
width: 71.42857142857143%;
4343
}
4444

4545
.prev,
4646
.next {
47-
float: left;
4847
max-height: 40px;
4948
position: relative;
5049
width: 14.285714285714286%;
@@ -61,6 +60,10 @@
6160
transform: translateX(-50%) translateY(-50%);
6261
}
6362
}
63+
64+
&.rtl {
65+
transform: rotate(180deg);
66+
}
6467
}
6568

6669
.prev {

0 commit comments

Comments
 (0)