Skip to content

Commit

Permalink
fix(pickerheader): Reorder prev/next buttons when rtl
Browse files Browse the repository at this point in the history
  • Loading branch information
mst101 committed Jun 30, 2021
1 parent 628768d commit d4ab12c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
22 changes: 2 additions & 20 deletions src/components/PickerHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<header>
<span
class="prev"
:class="{ disabled: isLeftNavDisabled }"
:class="{ disabled: isPreviousDisabled, rtl: isRtl }"
@click="$emit('page-change', -1)"
>
<slot name="prevIntervalBtn">
Expand All @@ -12,7 +12,7 @@
<slot />
<span
class="next"
:class="{ disabled: isRightNavDisabled }"
:class="{ disabled: isNextDisabled, rtl: isRtl }"
@click="$emit('page-change', 1)"
>
<slot name="nextIntervalBtn">
Expand All @@ -39,23 +39,5 @@ export default {
required: true,
},
},
computed: {
/**
* Is the left hand navigation button disabled?
* @return {Boolean}
*/
/* istanbul ignore next */
isLeftNavDisabled() {
return this.isRtl ? this.isNextDisabled : this.isPreviousDisabled
},
/**
* Is the right hand navigation button disabled?
* @return {Boolean}
*/
/* istanbul ignore next */
isRightNavDisabled() {
return this.isRtl ? this.isPreviousDisabled : this.isNextDisabled
},
},
}
</script>
9 changes: 6 additions & 3 deletions src/styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,18 @@
}

header {
display: block;
display: flex;
justify-content: space-between;
line-height: 40px;

span {
display: inline-block;
float: left;
text-align: center;
width: 71.42857142857143%;
}

.prev,
.next {
float: left;
max-height: 40px;
position: relative;
width: 14.285714285714286%;
Expand All @@ -61,6 +60,10 @@
transform: translateX(-50%) translateY(-50%);
}
}

&.rtl {
transform: rotate(180deg);
}
}

.prev {
Expand Down

0 comments on commit d4ab12c

Please sign in to comment.