Problem/Motivation
When create a Card component using ui_patterns, there are a number of errors in the browsers console that show up.
Unable to check <input pattern=‘^\s*((?!(?:\d|[-]\d))[\S]+(\s+(?!(?:\d|[-]\d))[\S]+)*)?\s*$’> because ‘/^\s*((?!(?:\d|[-]\d))[\S]+(\s+(?!(?:\d|[-]\d))[\S]+)*)?\s*$/v’ is not a valid regexp: invalid character in class in regular expression
Tried with both layout builder and display_suite+manage display.
Using Firefox as the browser.
Steps to reproduce
- Create a Card component as a section using layout_builder
- Look in browsers inspector console for the errors
Proposed resolution
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | console-errors-card-1.png | 151.99 KB | mengi |
| #3 | console-errors.png | 37.76 KB | mengi |
Issue fork ui_patterns-3494338
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
grimreaperHi,
Thanks for the bug report.
I tried to reproduce the bug with Layout Builder and manage display. I was not able to reproduce the bug.
Is it possible to get some screenshots or a short recording to show the error please?
Which UI Patterns version are you using?
Comment #3
mengi commentedUsing ui_patterns-beta6.
I was using Firefox, but I tried it using Chrome browser and the errors do not show up. So it seems to be browser based.
Error doesn't prevent using the Card component and it displays correctly.
Comment #4
mengi commentedComment #5
grimreaperThanks for the details.
Ok, on Firefox I too see the errors.
These errors comes from the attributes props with the "HTML classes" source, it is the "pattern" on the textfield input.
What is strange is that with other components which all have at least the standard attributes prop there is no error. Only with card.
Comment #6
grimreaperComment #7
pdureau commentedMikael, it looks like something you are currently working on, doesn't it?
Comment #8
just_like_good_vibeslooks like #3494336: [2.0.0-rc1] Validation error with identifier prop type is fixing the issue, can someome check please ?
Comment #9
grimreaperHi,
I have checked and the issue persist even with the fix of the other issue.
The fix in the other issue was on form submission.
This one is when the form is displayed.
Comment #11
just_like_good_vibesok i pushed a better fix
Comment #12
grimreaperThanks!
I confirm that now it is ok.
Comment #14
just_like_good_vibesComment #15
mengi commentedIt was strange that it was only Card that was effected. After some testing, I found it was because the Card attributes has a default value. (ui_suite_bootstrap theme 5.1)
I put a default value in modal.component.yml and the error showed up.
I can also confirm that the errors are now gone.