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

feat(textinput): do not block input on validation #185

Merged
merged 2 commits into from Mar 14, 2024

Commits on Mar 13, 2024

  1. feat(textinput): do not block input on validation

    This PR builds upon the excellent work in charmbracelet#167 and charmbracelet#114 and makes a
    breaking change to the validation API.
    
    Currently, validation will completely block text input if the Validate
    function returns an error. This is now changed so the function no longer
    blocks input if this is the case, thus handing this responsibility to
    the clients.
    
    This is helpful for cases where the user is requested to type an
    existing system path, and the Validate function keeps asserting the
    existence of the path. With the current implementation such a validation
    is not possible.
    
    For example:
    
        > /
        Err: nil
    
        > /t
        Err: /t: No such file or directory
    
        > /tm
        Err: /tm: No such file or directory
    
        > /tmp
        Err: nil
    GabrielNagy authored and maaslalani committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    e7b3760 View commit details
    Browse the repository at this point in the history
  2. fix: change name

    maaslalani committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    7f0383b View commit details
    Browse the repository at this point in the history