Browse Source

Select: update docs for automatic-dropdown (#10727)

杨奕 7 years ago
parent
commit
3eb377f72f

+ 1 - 0
examples/docs/en-US/select.md

@@ -685,6 +685,7 @@ If the binding value of Select is an object, make sure to assign `value-key` as
 | reserve-keyword | when `multiple` and `filter` is true, whether to reserve current keyword after selecting an option | boolean | — | false |
 | default-first-option | select first matching option on enter key. Use with `filterable` or `remote` | boolean | - | false |
 | popper-append-to-body| whether to append the popper menu to body. If the positioning of the popper is wrong, you can try to set this prop to false | boolean | - | true |
+| automatic-dropdown | for non-filterable Select, this prop decides if the option menu pops up when the input is focused | boolean | - | false |
 
 ### Select Events
 | Event Name | Description | Parameters |

+ 1 - 0
examples/docs/es/select.md

@@ -691,6 +691,7 @@ Si el valor de encuadernación de Select es un objeto, asegúrese de asignar `va
 | reserve-keyword      | cuando `multiple` y `filter` es `true`, si se debe reservar la palabra clave actual después de seleccionar una opción. | boolean  | —                 | false            |
 | default-first-option | seleccione la primera opción de coincidencia en la tecla enter. Uso con `filterable` o `remote`. | boolean  | -                 | false            |
 | popper-append-to-body| si añadir o no el menu popup al body. Si el posicionamiento del popup es incorrecto, puede intentar poner este `prop` en `false`. | boolean | - | true |
+| automatic-dropdown | for non-filterable Select, this prop decides if the option menu pops up when the input is focused | boolean | - | false |
 
 ### Eventos Select
 | Nombre         | Descripción                              | Parametros                               |

+ 1 - 0
examples/docs/zh-CN/select.md

@@ -680,6 +680,7 @@
 | reserve-keyword | 多选且可搜索时,是否在选中一个选项后保留当前的搜索关键词 | boolean | — | false |
 | default-first-option | 在输入框按下回车,选择第一个匹配项。需配合 `filterable` 或 `remote` 使用 | boolean | - | false |
 | popper-append-to-body | 是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false | boolean | - | true |
+| automatic-dropdown | 对于不可搜索的 Select,是否在输入框获得焦点后自动弹出选项菜单 | boolean | - | false |
 
 ### Select Events
 | 事件名称 | 说明 | 回调参数 |

+ 1 - 1
packages/select/src/select.vue

@@ -549,7 +549,7 @@
 
       handleFocus(event) {
         if (!this.softFocus) {
-          if (this.automaticDropdown || event.target.className.indexOf('el-select__input') > -1) {
+          if (this.automaticDropdown || this.filterable) {
             this.visible = true;
             this.menuVisibleOnFocus = true;
           }

+ 0 - 5
packages/theme-chalk/src/select.scss

@@ -113,11 +113,6 @@
     display: flex;
     align-items: center;
     flex-wrap: wrap;
-
-    > span {
-      display: inline-block;
-      width: 100%;
-    }
   }
 
   .el-tag__close {