question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add auto trim property to text form components such as MudTextField

See original GitHub issue

Feature request type

Enhance component

Component name

MudTextField

Is your feature request related to a problem?

No response

Describe the solution you’d like

I know auto trim can be easily accomplished via ValueChanged, but adding these to dozens of text form controls can become cumbersome. It’d be very nice if we can keep using @bind-Value along with a new property AutoTrim to automatically trim user inputs before triggering any validation/submission logic.

Have you seen this feature anywhere else?

No response

Describe alternatives you’ve considered

No response

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
henoncommented, Aug 3, 2022

Example for a trimming converter. Conversion is done before validation: https://try.mudblazor.com/snippet/QOccaCOHTqWgnlHx

image

0reactions
mckaragozcommented, Aug 3, 2022

Please inform if this approach fails.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MudTextField
Name Type Default Mask IMask null Text string null Value T null
Read more >
Trim() input value of any TextField in a Form by default in ...
This will only work if spaces in between are disallowed. Trim the text value on onChanged callback and assign it back to the...
Read more >
MudTextField ValueChanged event doesn't fire when ...
I'm building a dynamic forms application and I'm trying to nest components within components and allow their events to bubble up to the...
Read more >
Trim text before submit form - Power Platform Community
Solved: Hi, Is it possible to trim the text that user input before submit form? I tried with "Field.Text = trim(Field.Text)" and update....
Read more >
Untitled
onChanged property - TextField class - material library My First .Net MAUI App - Medium How to get the changed value in Input...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found