Skip to content

Commit 625ac80

Browse files
author
adi
committed
Add RTL support
1 parent 7a2fad6 commit 625ac80

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

dev.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +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>
3536
<v-select placeholder="multiple" multiple :options="options"></v-select>
3637
<v-select placeholder="multiple, taggable" multiple taggable :options="options" no-drop></v-select>
3738
<v-select placeholder="multiple, taggable, push-tags" multiple push-tags taggable :options="[{label: 'Foo', value: 'foo'}]"></v-select>

src/components/Select.vue

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@
99
-moz-box-sizing: border-box;
1010
box-sizing: border-box;
1111
}
12+
/* Rtl support */
13+
.v-select.rtl .open-indicator {
14+
left: 10px;
15+
right: auto;
16+
}
17+
.v-select.rtl .selected-tag {
18+
float: right;
19+
margin-right: 3px;
20+
margin-left: 1px;
21+
}
22+
.v-select.rtl .dropdown-menu {
23+
text-align: right;
24+
}
1225
/* Open Indicator */
1326
.v-select .open-indicator {
1427
position: absolute;
@@ -517,7 +530,16 @@
517530
*/
518531
inputId: {
519532
type: String
520-
}
533+
},
534+
535+
/**
536+
* Sets Rtl support.
537+
* @type {Boolean}
538+
*/
539+
rtl: {
540+
type: Boolean,
541+
default: false
542+
},
521543
},
522544
523545
data() {
@@ -796,7 +818,8 @@
796818
searching: this.searching,
797819
searchable: this.searchable,
798820
unsearchable: !this.searchable,
799-
loading: this.mutableLoading
821+
loading: this.mutableLoading,
822+
rtl: this.rtl
800823
}
801824
},
802825
@@ -806,7 +829,7 @@
806829
*/
807830
clearSearchOnBlur() {
808831
return this.clearSearchOnSelect && !this.multiple
809-
},
832+
},
810833
811834
/**
812835
* Return the current state of the

0 commit comments

Comments
 (0)