You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using [CascadingParameter] ModalInstance, apparently the onkeyup and onkeydown handlers in FocusTrap sets the CascadedValue every time any keyup/keydown DOM event is generated in a child component, which rerenders the component twice for every key press.
This causes OnParametersSet to be called in Typeahead. If you remove these 2 event handlers, the Typeahead component also works as intended. See Blazored/Typeahead#288
It does seem to generate some overhead. Perhaps it's possible to disable event propagation?
Thanks for opening this issue @BeyondDefinition. I think the solution to this is pretty simple, currently the BlazoredModalInstance value that is cascaded down isn't fixed. I've just done a quick test and setting it to fixed will resolve this.
That indeed solves it! Thanks!
I wish it was always as easy as adding IsFixed="true" to fix an issue!
Can you please include this improvement in the next release?
Describe the bug
When using
[CascadingParameter] ModalInstance
, apparently the onkeyup and onkeydown handlers in FocusTrap sets the CascadedValue every time any keyup/keydown DOM event is generated in a child component, which rerenders the component twice for every key press.This causes OnParametersSet to be called in Typeahead. If you remove these 2 event handlers, the Typeahead component also works as intended. See Blazored/Typeahead#288
It does seem to generate some overhead. Perhaps it's possible to disable event propagation?
To Reproduce
Steps to reproduce the behavior:
[CascadingParameter] ModalInstance
and manually implement the getter + setter.Debugger.Log
.Expected behavior
Rerender only when the component state has actually changed, not twice for every key press.
Hosting Model (is this issue happening with a certain hosting model?):
The text was updated successfully, but these errors were encountered: