Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete: add popper-append-to-body attribute #12241

Merged
merged 1 commit into from Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/docs/en-US/input.md
Expand Up @@ -712,6 +712,7 @@ Attribute | Description | Type | Options | Default
| prefix-icon | prefix icon class | string | — | — |
| suffix-icon | suffix icon class | string | — | — |
| hide-loading | whether to hide the loading icon in remote search | boolean | — | false |
| popper-append-to-body | whether to append the dropdown to body. If the positioning of the dropdown is wrong, you can try to set this prop to false | boolean | - | true |

### Autocomplete Slots

Expand Down
1 change: 1 addition & 0 deletions examples/docs/es/input.md
Expand Up @@ -691,6 +691,7 @@ Atributo | Descripción | Tipo | Opciones | Por defecto
| prefix-icon | prefix icon class | string | — | — |
| suffix-icon | suffix icon class | string | — | — |
| hide-loading | si se debe ocultar el icono de loading en la búsqueda remota | boolean | — | false |
| popper-append-to-body | whether to append the dropdown to body. If the positioning of the dropdown is wrong, you can try to set this prop to false | boolean | - | true |

### Autocomplete Slots

Expand Down
1 change: 1 addition & 0 deletions examples/docs/zh-CN/input.md
Expand Up @@ -864,6 +864,7 @@ export default {
| prefix-icon | 输入框头部图标 | string | — | — |
| suffix-icon | 输入框尾部图标 | string | — | — |
| hide-loading | 是否隐藏远程加载时的加载图标 | boolean | — | false |
| popper-append-to-body | 是否将下拉列表插入至 body 元素。在下拉列表的定位出现问题时,可将该属性设置为 false | boolean | - | true |

### Autocomplete Slots
| name | 说明 |
Expand Down
7 changes: 6 additions & 1 deletion packages/autocomplete/src/autocomplete.vue
Expand Up @@ -35,6 +35,7 @@
visible-arrow
:class="[popperClass ? popperClass : '']"
:popper-options="popperOptions"
:append-to-body="popperAppendToBody"
ref="suggestions"
:placement="placement"
:id="id">
Expand Down Expand Up @@ -116,7 +117,11 @@
type: String,
default: 'bottom-start'
},
hideLoading: Boolean
hideLoading: Boolean,
popperAppendToBody: {
type: Boolean,
default: true
}
},
data() {
return {
Expand Down
3 changes: 3 additions & 0 deletions types/autocomplete.d.ts
Expand Up @@ -65,6 +65,9 @@ export declare class ElAutocomplete extends ElementUIComponent {
/** Whether to hide the loading icon in remote search */
hideLoading: boolean

/** Whether to append the dropdown to body */
popperAppendToBody: boolean

/**
* Focus the Input component
*/
Expand Down
3 changes: 3 additions & 0 deletions types/select.d.ts
Expand Up @@ -69,6 +69,9 @@ export declare class ElSelect extends ElementUIComponent {
/** Select first matching option on enter key. Use with filterable or remote */
defaultFirstOption: boolean

/** Whether to append the popper menu to body */
popperAppendToBody: boolean

/**
* Focus the Input component
*/
Expand Down