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

Pattern field validation with a long error message is hidden behind field label #1654

Closed
MitchellCash opened this issue Aug 23, 2018 · 9 comments · Fixed by #7260
Closed

Comments

@MitchellCash
Copy link
Contributor

Describe the bug
When you create a pattern validation for a field and include a long error message, it flows to the width of the input field and gets hidden behind the input field label.

To Reproduce
Steps to reproduce the behavior:

  1. Create a field with pattern validation and a long error message (see my CMS configuration below)
  2. Go to CMS and the field with the pattern validation
  3. Enter a message in the field that fails validation
  4. Note that the error message can get hidden behind the field label

Expected behavior
The message does not get hidden and remains readable.

Screenshots
Netlify CMS long error message

Applicable Versions:

  • Netlify CMS version: 2.0.9
  • Git provider: GitHub
  • OS: macOS 10.13.6
  • Browser version: Firefox 61.0.2 (64-bit)

CMS configuration

- label: "Site Settings"
  name: "site_settings"
  file: "_data/site.yml"
  fields:
    - label: Site Description
      name: description
      widget: string
      pattern: ['^.{50,300}$', "For best results in Google, we recommend 50-300 characters."]
    - {label: Google Analytics Tracking ID, name: google_tracking_id, widget: string}
@mittalyashu

This comment has been minimized.

@tech4him1

This comment has been minimized.

@mittalyashu
Copy link
Contributor

mittalyashu commented Aug 30, 2018

I have done some work on the fields.

NOTE: I am still not sure about the colors, but we can discuss about it.

How about this design?

image

Check the above link for the source.

@mittalyashu
Copy link
Contributor

@erquhart Any comments?

@mittalyashu
Copy link
Contributor

@tech4him1 I don't see anything like this in docs where we can set custom error message.

@tech4him1
Copy link
Contributor

@mittalyashu See the example code in the initial issue description:

pattern: ['^.{50,300}$', "For best results in Google, we recommend 50-300 characters."]

The phrase "For best results in Google, we recommend 50-300 characters." is used as the error message.

@mittalyashu
Copy link
Contributor

mittalyashu commented Sep 3, 2018

That's I get it, what I am trying to say, is it in the NetlifyCMS docs?

If it is not, then we can add it in the docs.

@tech4him1
Copy link
Contributor

Yes, just use the docs search: https://www.netlifycms.org/docs/widgets/#common-widget-options

@stale
Copy link

stale bot commented Oct 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

Successfully merging a pull request may close this issue.

5 participants