File tree Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,9 @@ class Chosen extends AbstractChosen
243
243
@form_field_jq .trigger (" chosen:maxselected" , {chosen : this })
244
244
return false
245
245
246
+ unless @is_multiple
247
+ @search_container .append @search_field
248
+
246
249
@container .addClass " chosen-with-drop"
247
250
@results_showing = true
248
251
@@ -259,6 +262,10 @@ class Chosen extends AbstractChosen
259
262
if @results_showing
260
263
this .result_clear_highlight ()
261
264
265
+ unless @is_multiple
266
+ @selected_item .prepend @search_field
267
+ @search_field .focus ()
268
+
262
269
@container .removeClass " chosen-with-drop"
263
270
@form_field_jq .trigger (" chosen:hiding_dropdown" , {chosen : this })
264
271
Original file line number Diff line number Diff line change @@ -235,6 +235,9 @@ class @Chosen extends AbstractChosen
235
235
@form_field .fire (" chosen:maxselected" , {chosen : this })
236
236
return false
237
237
238
+ unless @is_multiple
239
+ @search_container .insert @search_field
240
+
238
241
@container .addClassName " chosen-with-drop"
239
242
@results_showing = true
240
243
@@ -251,6 +254,10 @@ class @Chosen extends AbstractChosen
251
254
if @results_showing
252
255
this .result_clear_highlight ()
253
256
257
+ unless @is_multiple
258
+ @selected_item .insert top : @search_field
259
+ @search_field .focus ()
260
+
254
261
@container .removeClassName " chosen-with-drop"
255
262
@form_field .fire (" chosen:hiding_dropdown" , {chosen : this })
256
263
Original file line number Diff line number Diff line change @@ -332,12 +332,12 @@ class AbstractChosen
332
332
get_single_html : ->
333
333
"""
334
334
<a class="chosen-single chosen-default">
335
+ <input class="chosen-search-input" type="text" autocomplete="off" />
335
336
<span>#{ @default_text } </span>
336
337
<div><b></b></div>
337
338
</a>
338
339
<div class="chosen-drop">
339
340
<div class="chosen-search">
340
- <input class="chosen-search-input" type="text" autocomplete="off" />
341
341
</div>
342
342
<ul class="chosen-results"></ul>
343
343
</div>
Original file line number Diff line number Diff line change 20
20
border-top : 0 ;
21
21
background : #fff ;
22
22
box-shadow : 0 4px 5px rgba (#000 ,.15 );
23
- clip : rect ( 0 , 0 , 0 , 0 ) ;
23
+ display : none ;
24
24
}
25
25
& .chosen-with-drop .chosen-drop {
26
- clip : auto ;
26
+ display : block ;
27
27
}
28
28
a {
29
29
cursor : pointer ;
65
65
text-decoration : none ;
66
66
white-space : nowrap ;
67
67
line-height : 24px ;
68
+
69
+ input [type = " text" ] {
70
+ cursor : pointer ;
71
+ opacity : 0 ;
72
+ position : absolute ;
73
+ }
68
74
}
69
75
.chosen-default {
70
76
color : #999 ;
You can’t perform that action at this time.
0 commit comments