Skip to content

Commit d9fd2fd

Browse files
author
Jeff
committed
improve RTL support
1 parent 2960029 commit d9fd2fd

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

dev.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<body>
3333
<div id="app">
3434
<v-select placeholder="default" :options="options"></v-select>
35-
<v-select placeholder="default, RTL" :options="options" :rtl="true" dir="rtl"></v-select>
35+
<v-select placeholder="default, RTL" :options="options" dir="rtl"></v-select>
3636
<v-select placeholder="multiple" multiple :options="options"></v-select>
3737
<v-select placeholder="multiple, taggable" multiple taggable :options="options" no-drop></v-select>
3838
<v-select placeholder="multiple, taggable, push-tags" multiple push-tags taggable :options="[{label: 'Foo', value: 'foo'}]"></v-select>

src/components/Select.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@
283283
</style>
284284

285285
<template>
286-
<div class="dropdown v-select" :class="dropdownClasses">
286+
<div :dir="dir" class="dropdown v-select" :class="dropdownClasses">
287287
<div ref="toggle" @mousedown.prevent="toggleDropdown" :class="['dropdown-toggle', 'clearfix', {'disabled': disabled}]">
288288

289289
<span class="selected-tag" v-for="option in valueAsArray" v-bind:key="option.index">
@@ -551,12 +551,14 @@
551551
},
552552
553553
/**
554-
* Sets Rtl support.
555-
* @type {Boolean}
554+
* Sets RTL support. Accepts 'ltr', 'rtl', 'auto'.
555+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir
556+
* @type {String}
557+
* @default 'auto'
556558
*/
557-
rtl: {
558-
type: Boolean,
559-
default: false
559+
dir: {
560+
type: String,
561+
default: 'auto'
560562
},
561563
},
562564
@@ -839,7 +841,7 @@
839841
searchable: this.searchable,
840842
unsearchable: !this.searchable,
841843
loading: this.mutableLoading,
842-
rtl: this.rtl
844+
rtl: this.dir === 'rtl'
843845
}
844846
},
845847

0 commit comments

Comments
 (0)