Overview
If you start typing in a prop field and pause long enough or just type slowly enough for it to try to re-render the component, it can cause a premature validation error and break the UI. This is especially acute for link fields, for example, which require non-trivial typing before they become valid.

Proposed resolution
- Add clientside HTML5 and JSON Schema Validation
- Refactor inputBehaviors entirely - move logic into multiple files that separate various concerns.
Refactor iri/uri props to not use the url widget because that creates an input with type="url" which has HTML5 validation expecting an absolute path. The JSON schema validation will take care of what we need
User interface changes
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 2024-10-21 11.05.08.gif | 420.58 KB | jessebaker |
| premature-prop-validation.gif | 374.71 KB | traviscarden |
Issue fork experience_builder-3474732
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 #4
bnjmnmComment #5
bnjmnmThis will likely be dormant for a week or so while DrupalCon happens. The plan is nything in the schemas that can be enforced by html5 validation will be added as attributes to the form inputs. Some things such as type enforcement in some element types can't be achieved this way (select is just gonna store strings even if we want numbers) - but letting the browser enforce where possible should help minimize the overall spaghetti.
Comment #6
bnjmnm99% done -
FieldTypeUninstallValidatorTestis failing and I'm not yet sure why. Unassigning myself to open this up to contributors who have had more exposure to that test and might be able to figure it out more quickly. In the meantime I'll keep debugging to see what is happening.Comment #7
wim leersTed knows that test the best.
Comment #9
tedbowFieldTypeUninstallValidatorTestwas failing it tests we can uninstall thelinkmodule after we remove all uses in XB fields. Now thatlinkis a dependency of XB we get an error after remove all the links uses because it tries to also uninstall XB but its fields are in use on bundles.Fix the test to make sure we don't get "link" at ll in the uninstall error message at after we have removed all the uses of the link field
there is merge error now in one of the .js tests so assigning back to @bnjmnm
Comment #10
bnjmnmSorry for the chungus MR, but it is ready.
Comment #11
jessebaker commentedI've done a bit of manual testing and found some issues around entering numbers. Would you prefer to address here, or else I can raise them as new issues?
On a required, string, field (E.g. the Heading field on the default Hero component)
On a URI field (E.g. the CTA 1 Link field on the default Hero component)
Comment #12
bnjmnmComment #13
effulgentsia commentedComment #14
tedbowneeded to merge 0.x but now test are failing
Comment #15
bnjmnmComment #16
tedbowComment #17
tedbowComment #18
tedbowComment #20
balintbrewsComment #21
tedbowComment #22
tedbowLooks like this needs @wim leers or @f.mazeikis approval to merge
Comment #24
bnjmnmComment #26
wim leers