Skip to content
Snippets Groups Projects
Commit 311dccfa authored by Timothee P's avatar Timothee P :sunflower:
Browse files

toggle dropdown method only if dropdown open, avoiding keyboard opening on iOS

parent 20034de8
No related branches found
No related tags found
2 merge requests!424version 3.1.0,!324REDMINE_ISSUE-13328
......@@ -125,11 +125,10 @@ export default {
methods: {
toggleDropdown(val) {
if (this.isOpen) {
this.input = ''; // * clear input field when closing dropdown
} else if (this.search) {
//* focus on input if is a search dropdown
this.$refs.input.focus({
if (this.isOpen) { //* if dropdown is open :
this.input = ''; // * -> clear input field when closing dropdown
} else if (this.search) { //* if dropdown is closed is a search dropdown:
this.$refs.input.focus({ //* -> focus on input field
preventScroll: true,
});
} else if (this.clearable && val.target && this.selected) {
......@@ -172,8 +171,9 @@ export default {
},
clickOutsideDropdown(e) {
if (!e.target.closest(`#custom-dropdown${this.identifier}`))
if (!e.target.closest(`#custom-dropdown${this.identifier}`) && this.isOpen) {
this.toggleDropdown(false);
}
},
},
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment