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

Fixed multiple Autocomplete Issues #548

Merged
merged 3 commits into from
May 16, 2020

Conversation

sandrohanea
Copy link
Contributor

Issues Fixed:
#315
#430
#246 - partial
#213

Also as all of them were related to the edit form I added an example in the demo using the EditForm + MatAutocompleteList and validation for the selected option.

This feature is also resolved already so can be closed: #267

@enkodellc
Copy link
Collaborator

enkodellc commented May 15, 2020

One feature that works in the master branch but is now broken in develop, even before our recent changes is the select by enter key.

  1. Use up and down arrow to select an item
  2. Click enter key -> should select the item does not in develop but does: https://www.matblazor.com/AutocompleteList

I have tested and I know the code is firing but it reports an error:

blazor.webassembly.js:1 Uncaught (in promise) Error: System.ArgumentException: There is no event handler associated with this event. EventId: '1493'.
Parameter name: eventHandlerId

@enkodellc enkodellc self-assigned this May 15, 2020
@sandrohanea
Copy link
Contributor Author

Thanks for the finding, I'll go to sleep now but I'll fix it tomorrow morning. :)

@sandrohanea
Copy link
Contributor Author

I checked and the error was reproducing since the beginning of that feature on WASM builds(on master too). The cause of that issue was that OnEnter a JS function was called on MatList to confirm the selection which tried to dispatch an event(MouseDown) that didn't work on WASM.

I changed the behavior of how MatAutocompleteList is selecting an item on pressing enter(calling directly the Blazor method which sets the Selected Item) and cached the result to not query the entities every time when the user is pressing enter. As the selection behavior changes are helpful for server-side Blazor too as when the user is pressing enter, the server is not calling a js(in client) which should call another method in server to set the selected item and rerender them in the client (Client event-> Server process -> Client dispatch mouse down -> Server process -> Client display) but now it's directly Client(enter) -> Server(processing) -> Client(display).

The caching is also helping when the state is changed but neither the search text nor the Items are changed to not reiterate the items.

@enkodellc
Copy link
Collaborator

@sandrohanea this all looks great to me. I will merge and close all the issues:

@lindespang or @SamProf It looks like we have @sandrohanea as the man for maintaining the AutoComplete

490, 406, 278, 315, 430, 213, 246 - Didn't tag as they were already referenced by @sandrohanea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants