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

Refactor the TextChanged mode for TextEdit and NumericEdit to be configured for each instance #998

Closed
intiharj opened this issue Jun 19, 2020 · 2 comments · Fixed by #1096
Labels
Type: Feature Request ⛱ New feature or request
Projects
Milestone

Comments

@intiharj
Copy link

Currently, one can toggle the Blazorise.Options.ChangeTextOnKeyPress value in Statup.ConfigureSerices to control the way all TextEdit and NumericEdit instances behave in an application. For server-side applications, we usually want this set to false to support a user rapidly typing long text strings. However, there are common cases where we want the UI to update on each key stroke ( vs waiting for a control to lose focus). Examples are: update search results as the user types; update a price calculator as the user tweaks a numeric value. Perhaps this would also be valuable on Slider as well.

Suggested implementation would be something like a TextChangedMode or BindValueMode property on TextEdit and NumericEdit of type Blazorise.TextChangedMode ( enum TextChangedMode { OnLostFocus = 0, OnInput = 1 }

@stsrki
Copy link
Collaborator

stsrki commented Jun 19, 2020

Thank you for writing the ticket. I just realized there are KeyDown, KeyPress and KeyUp events on TextEdit. Numeric still lacks similar events. Hopefully that will work for you for now, until I add the requested feature for all input components.

@stsrki stsrki added the Type: Feature Request ⛱ New feature or request label Jun 19, 2020
@stsrki stsrki added this to the 0.9.2 milestone Jun 19, 2020
@intiharj
Copy link
Author

I tried the KeyX events. While they tell me what key the user hit, I don't see a way to access the total string that the user sees. I was able to work around this by subclassing NumericEdit and flipping Options.ChangeTextOnKeyPress to true in MyNumericEdit.OnInitialized().

@stsrki stsrki added this to 🔙 Backlog in Development via automation Jul 3, 2020
@stsrki stsrki moved this from 🔙 Backlog to ⏳ To do in Development Jul 6, 2020
@stsrki stsrki moved this from ⏳ To do to 💪 In progress in Development Jul 6, 2020
@stsrki stsrki mentioned this issue Jul 6, 2020
84 tasks
@stsrki stsrki closed this as completed Jul 6, 2020
Development automation moved this from 💪 In progress to ✔ Done Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Request ⛱ New feature or request
Projects
Development
  
✔ Done
Development

Successfully merging a pull request may close this issue.

2 participants