Skip to content

Commit 2960029

Browse files
authored
Merge pull request sagalbot#274 from adi518/master
Add RTL support
2 parents 50f9bcc + d1e6fdd commit 2960029

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
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: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,19 @@
1515
-moz-box-sizing: border-box;
1616
box-sizing: border-box;
1717
}
18-
18+
/* Rtl support */
19+
.v-select.rtl .open-indicator {
20+
left: 10px;
21+
right: auto;
22+
}
23+
.v-select.rtl .selected-tag {
24+
float: right;
25+
margin-right: 3px;
26+
margin-left: 1px;
27+
}
28+
.v-select.rtl .dropdown-menu {
29+
text-align: right;
30+
}
1931
/* Open Indicator */
2032
.v-select .open-indicator {
2133
position: absolute;
@@ -183,9 +195,9 @@
183195
clear: none;
184196
}
185197
/* Search Input States */
186-
.v-select.unsearchable input[type="search"] {
198+
/* .v-select.unsearchable input[type="search"] {
187199
max-width: 1px;
188-
}
200+
} */
189201
/* List Items */
190202
.v-select li {
191203
line-height: 1.42857143; /* Normalize line height */
@@ -536,7 +548,16 @@
536548
*/
537549
inputId: {
538550
type: String
539-
}
551+
},
552+
553+
/**
554+
* Sets Rtl support.
555+
* @type {Boolean}
556+
*/
557+
rtl: {
558+
type: Boolean,
559+
default: false
560+
},
540561
},
541562
542563
data() {
@@ -817,7 +838,8 @@
817838
searching: this.searching,
818839
searchable: this.searchable,
819840
unsearchable: !this.searchable,
820-
loading: this.mutableLoading
841+
loading: this.mutableLoading,
842+
rtl: this.rtl
821843
}
822844
},
823845
@@ -827,7 +849,7 @@
827849
*/
828850
clearSearchOnBlur() {
829851
return this.clearSearchOnSelect && !this.multiple
830-
},
852+
},
831853
832854
/**
833855
* Return the current state of the

0 commit comments

Comments
 (0)