Fixed #2619 - Add a param to the show() method to focus Dropdown component

pull/2623/head
mertsincan 2022-06-02 14:11:37 +01:00
parent 319df1e932
commit 5fe9f29d67
2 changed files with 4 additions and 2 deletions

View File

@ -238,9 +238,11 @@ export default {
isSelected(option) { isSelected(option) {
return ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey); return ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
}, },
show() { show(isFocus) {
this.$emit('before-show'); this.$emit('before-show');
this.overlayVisible = true; this.overlayVisible = true;
isFocus && this.$refs.focusInput.focus();
}, },
hide() { hide() {
this.$emit('before-hide'); this.$emit('before-hide');

View File

@ -379,7 +379,7 @@ export default {
<tbody> <tbody>
<tr> <tr>
<td>show</td> <td>show</td>
<td>-</td> <td>isFocus: Decides whether to focus on the component. Default value is false.</td>
<td>Shows the overlay.</td> <td>Shows the overlay.</td>
</tr> </tr>
<tr> <tr>