Skip to content

Commit

Permalink
fix(VRating): check if half-increments prop is used alongside rtl
Browse files Browse the repository at this point in the history
fixes #10093
  • Loading branch information
johnleider committed Jan 10, 2020
1 parent df502ff commit ddf3aec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/vuetify/src/components/VRating/VRating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,14 @@ export default mixins(
},
genHoverIndex (e: MouseEvent, i: number) {
let isHalf = this.isHalfEvent(e)
if (this.$vuetify.rtl) isHalf = !isHalf

if (
this.halfIncrements &&
this.$vuetify.rtl
) {
isHalf = !isHalf
}

return i + (isHalf ? 0.5 : 1)
},
getIconName (props: ItemSlotProps): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ describe('VRating.ts', () => {

it('should check for half event in rtl', () => {
const wrapper = mountFunction({
propsData: { halfIncrements: true },
mocks: {
$vuetify: {
rtl: true,
Expand Down

0 comments on commit ddf3aec

Please sign in to comment.