-
Notifications
You must be signed in to change notification settings - Fork 21
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
More robust autocomplete #1860
More robust autocomplete #1860
Conversation
Deployed to https://pr-1860.aam-digital.net/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good and seems to work well (although I didn't experience the bug previously either).
Tested:
single select:
- existing value displayed initially
- able to use autocomplete, see all options dropdown, type to narrow options
- click outside to reset (discarding anything typed; showing selected options as string again)
- select a new/additional option (value shown in string, dropdown closed, able to open dropdown again || multi: )
- add a new option
⚠️
clicking to add new option currently does not show the yes/no confirmation and instead shows the dropdown at the top left corner of the screen. No option is added.
multi select:
- existing value displayed initially
- able to use autocomplete, see all options dropdown, type to narrow options
- click outside to reset (discarding anything typed; showing selected options as string again)
- select a new/additional option (dropdown remains open, able to select further values, value shown in string on focus out)
- add a new option (confirmation dialog, nothing on "No", created and selected on "Yes")
If we can, we should hide that checkmark on the right of the option in multi mode. This is somewhat inconsistent with the checkboxes.
@@ -82,7 +82,17 @@ export class BasicAutocompleteComponent<O, V = O> | |||
startWith([] as SelectableOption<O, V>[]) | |||
); | |||
showAddOption = false; | |||
private delayedBlur: any; | |||
|
|||
get displayText() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this going against #1087 and we should rather set a variable instead of a getter?
src/app/core/configurable-enum/basic-autocomplete/basic-autocomplete.component.ts
Outdated
Show resolved
Hide resolved
src/app/core/configurable-enum/basic-autocomplete/basic-autocomplete.component.ts
Outdated
Show resolved
Hide resolved
} | ||
setTimeout(() => this.inputElement.focus()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's comment extensively why we need a timeout here and what are the tradeoffs (as we might face some related bugs again in the future 😉 )
src/app/core/configurable-enum/basic-autocomplete/basic-autocomplete.component.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
succesfully tested after the further changes
Kudos, SonarCloud Quality Gate passed! 1 Bug No Coverage information |
🎉 This PR is included in version 3.21.0-master.8 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.21.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
These changes should make the basic autocomplete component more robust on different/slower browsers.
Visible/Frontend Changes
Architectural/Backend Changes