File tree Expand file tree Collapse file tree 3 files changed +32
-3
lines changed Expand file tree Collapse file tree 3 files changed +32
-3
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2015 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ namespace Magento \Ui \Component \Form \Element ;
8
+
9
+ class MultiSelect extends Select
10
+ {
11
+ const NAME = 'multiselect ' ;
12
+
13
+ const DEFAULT_SIZE = 6 ;
14
+
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ public function prepare ()
19
+ {
20
+ $ config ['size ' ] = self ::DEFAULT_SIZE ;
21
+ $ this ->setData ('config ' , array_replace_recursive ((array )$ this ->getData ('config ' ), $ config ));
22
+ parent ::prepare ();
23
+ }
24
+ }
Original file line number Diff line number Diff line change 163
163
</item >
164
164
</argument >
165
165
</select >
166
- <multiselect class =" Magento\Ui\Component\Form\Element\Select " >
166
+ <multiselect class =" Magento\Ui\Component\Form\Element\MultiSelect " >
167
167
<argument name =" data" xsi : type =" array" >
168
168
<item name =" template" xsi : type =" string" >ui/form/element/multiselect</item >
169
169
<item name =" js_config" xsi : type =" array" >
173
173
<item name =" elementTmpl" xsi : type =" string" >ui/form/element/multiselect</item >
174
174
</item >
175
175
</item >
176
+ <item name =" config" xsi : type =" array" >
177
+ <item name =" size" xsi : type =" string" >6</item >
178
+ </item >
176
179
</argument >
177
180
</multiselect >
178
181
<textarea class =" Magento\Ui\Component\Form\Element\Textarea" >
Original file line number Diff line number Diff line change @@ -20,8 +20,10 @@ define([
20
20
*
21
21
* @returns {Number|String }
22
22
*/
23
- getInitialValue : function ( ) {
24
- var value = this . _super ( ) ;
23
+ normalizeData : function ( value ) {
24
+ if ( utils . isEmpty ( value ) ) {
25
+ value = [ ] ;
26
+ }
25
27
26
28
return _ . isString ( value ) ? value . split ( ',' ) : value ;
27
29
} ,
You can’t perform that action at this time.
0 commit comments