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

Text Field “Pattern” Property Doesn't Enforce Rule #2041

Closed
neildaniels opened this issue Aug 27, 2019 · 2 comments

Comments

@neildaniels
Copy link
Contributor

commented Aug 27, 2019

Describe the bug
When trying to use the pattern property of a text field, nothing seems to have any effect.

https://forum.getkirby.com/t/how-to-use-text-field-pattern-property/15416

To Reproduce

color:
  type: text
  placeholder: '#ffffff'
  converter: lower
  pattern: '/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/'

Expected behavior
This field should complain about invalid input when typing in something like test, but no error is thrown.

Kirby Version
3.2.3

Desktop (please complete the following information):

  • OS: macOS 10.15 Beta (19A536g)
  • Safari 13.0 (15608.2.2)
@neildaniels neildaniels changed the title Text Field “Pattern” Property Doesn't Work Text Field “Pattern” Property Doesn't Enforce Rule Aug 27, 2019
@texnixe

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2019

What does work, though:

    fields:
      color:
        label: Color
        type: text
        validate:
          match: "/^[0-9–]+$/m"

But this validate option is not documented, just came across it again while cleaning up.

@distantnative distantnative self-assigned this Sep 14, 2019
distantnative added a commit that referenced this issue Sep 14, 2019
@distantnative distantnative added this to the 3.2.5 milestone Sep 14, 2019
distantnative added a commit that referenced this issue Sep 14, 2019
distantnative added a commit that referenced this issue Sep 15, 2019
bastianallgeier added a commit that referenced this issue Sep 16, 2019
@bastianallgeier

This comment has been minimized.

Copy link
Contributor

commented Sep 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.