Skip to content

ignore invalid characters #24

Open

Description

@AlexeyTipunin

Hello.
Is it possible to ignore when entering invalid characters?

Activity

  1. JohanLarsson commented on Aug 30, 2016

    @JohanLarsson
    Member

    Do you mean ignoring as in detecting that user types in a letter and not update the text in the numeric box with it?

    If so, no, there is currently no support for this. Not sure it is a nice user experience to type in things that gets removed.

    Same with swapping out decimal separator ',' -> '.', no support for it.

  2. AlexeyTipunin commented on Aug 30, 2016

    @AlexeyTipunin
    Author

    Too bad, sometimes it's a good way to protect against typing errors users are not getting along with your computer. Some users have problems with the use of a decimal point, too, would not be bad to have such a setting.

  3. JohanLarsson commented on Aug 30, 2016

    @JohanLarsson
    Member

    Are you interested in writing a PR for this? If so what would the API look like?
    Maybe a property ValidInput="[0-9]\."?
    Also we should probably notify via an event when we filter out input so that there is a way to notify user about what happened.

  4. JohanLarsson commented on Aug 30, 2016

    @JohanLarsson
    Member

    Side note: Have you seen the ValidationTrigger property? Setting it to PropertyChanged will give the user immediate feedback if validation fails.

  5. AlexeyTipunin commented on Aug 30, 2016

    @AlexeyTipunin
    Author

    The problem with this behavior is that despite the fact that the control signals in the model opishibke left recently successfully entered value with whom he continues to run the program.

    If you add the property "allow incorrect input", which is a value of true ignorirovalaby entries, otherwise the behavior is left as it is, it is now.

    I am interested in using this library, I have a similar, but your gorazdno soschnee and has almost everything you need, and even more)

  6. crosscourt commented on Mar 2, 2017

    @crosscourt

    I think its a good idea to prevent invalid characters.
    This is how most numeric inputs work.

  7. JohanLarsson commented on Mar 2, 2017

    @JohanLarsson
    Member

    What do we want the API to look like? We can spec things here in case someone writes a PR.

  8. crosscourt commented on May 3, 2018

    @crosscourt

    since it is a numeric input, it should be the default.
    but at least u can have a property like NumericOnly=true
    it should also not allow more than one dot '.'

  9. mgnslndh commented on Jul 2, 2018

    @mgnslndh

    I am also interested in using this library and I would like a setting that only accepts numeric input.

    I've done something similar before and did not use RegEx pattern. Instead I checked each new key press if the resulting string would be parsable (TryParse) using the actual type (int, double, etc). The display value in the text box was formatted according to the current culture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions