Skip to content

Commit

Permalink
Fixed #2619 - Add a param to the show() method to focus Dropdown comp…
Browse files Browse the repository at this point in the history
…onent
  • Loading branch information
mertsincan committed Jun 2, 2022
1 parent 319df1e commit 5fe9f29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/dropdown/Dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,11 @@ export default {
isSelected(option) {
return ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
},
show() {
show(isFocus) {
this.$emit('before-show');
this.overlayVisible = true;
isFocus && this.$refs.focusInput.focus();
},
hide() {
this.$emit('before-hide');
Expand Down
2 changes: 1 addition & 1 deletion src/views/dropdown/DropdownDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export default {
<tbody>
<tr>
<td>show</td>
<td>-</td>
<td>isFocus: Decides whether to focus on the component. Default value is false.</td>
<td>Shows the overlay.</td>
</tr>
<tr>
Expand Down

0 comments on commit 5fe9f29

Please sign in to comment.