Opened 5 months ago
Closed 3 months ago
#63878 closed enhancement (fixed)
Backport: add support for text inputs on the elements API
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Themes | Keywords: | has-patch needs-testing gutenberg-merge |
| Focuses: | Cc: |
Description
Backport for https://github.com/WordPress/gutenberg/pull/70378
What?
This PR adds elements support to text based form inputs. This PR also updates the experimental form block and the comments block to implement this.
Why?
So a theme can style consistently how forms should look like regardless of the plugins/blocks installed (if they opt in this new API)
This also opens the possibility to style the new form input blocks more granularly while making use of block tools instead of CSS, opening the option for UI controls in the future if we so desire
How?
By allowing styling of text based inputs using the elements API
Testing Instructions
# Enable the Form block under the experiments section
# Insert a Form block, add inputs of all kinds to it
# Edit your theme.json to style the inputs, this is how I did it on my active theme:
"elements": {
"textInput": {
"border": {
"radius": "0",
"style": "solid",
"width": "1px",
"color": "red"
},
"color": {
"text": "var(--wp--preset--color--theme-2)"
},
"typography": {
"fontFamily": "var(--wp--preset--font-family--inter)"
}
},
}
| Trunk | This PR with theme.json changes | This PR with no theme.json changes |
|---|---|---|
| | | |
Change History (16)
This ticket was mentioned in PR #9600 on WordPress/wordpress-develop by @onemaggie.
5 months ago
#1
- Keywords has-patch added
#2
@
5 months ago
- Component changed from General to Themes
- Keywords needs-testing added
- Type changed from defect (bug) to enhancement
#3
@
5 months ago
Test Report
Description
This report validates whether the indicated patch works as expected.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/9600
Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.29
- Server: nginx/1.29.0
- Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
- Browser: Chrome 139.0.0.0
- OS: Linux
- Theme: Twenty Twenty-Five 1.3
- MU Plugins: None activated
- Plugins:
- Gutenberg 21.5.0
- Test Reports 1.2.0
Steps
- Enable Gutenberg → Experiments → Blocks: add Form and input blocks.
- Create a new page. Insert one Form block and add text, email, url, password, search, tel, textarea, and a submit button.
- Visit the page on the front-end.
- In the active theme add the following to
theme.jsonunderelements, then refresh:
"elements": {
"textInput": {
"border": {
"radius": "0",
"style": "solid",
"width": "1px",
"color": "red"
},
"color": {
"text": ""
},
"typography": {
"fontFamily": "var(--wp--preset--font-family--inter)"
}
}
}
✖️ - the patch does not work
Additional Notes
- Used
https://schemas.wp.org/trunk/theme.jsonas the $schema - Got an error
Property textInput is not allowed
- No style updates on the input field
Supplemental Artifacts
#4
@
5 months ago
- Keywords reporter-feedback added; needs-testing removed
Hey @onemaggie,
I wasn't able to make your patch working on my end. Can you check my testing report https://core.trac.wordpress.org/ticket/63878#comment:3 and let me know what I missed?
Interestingly, I got the Property textInput is not allowed error when adding it under the elements key.
Cheers!
#5
follow-up:
↓ 6
@
4 months ago
Interestingly, I got the
Property textInput is not allowederror when adding it under the elements key.
The schema should be defined correctly. Could you provide the complete theme.json code you used for testing?
#6
in reply to:
↑ 5
@
4 months ago
- Keywords needs-testing added; reporter-feedback removed
Replying to wildworks:
Interestingly, I got the
Property textInput is not allowederror when adding it under the elements key.
The schema should be defined correctly. Could you provide the complete theme.json code you used for testing?
@wildworks - I just added it under styles -> elements in 2025 theme. This issue actually happens because 2025 is using https://schemas.wp.org/wp/6.7/theme.json, but that error is gone if I update to use https://schemas.wp.org/trunk/theme.json. I thought I was using trunk on my first test report.
New test result seems confirming this works, but only if the schema is using trunk version. Best if few more reports can confirm:
#7
@
4 months ago
This issue actually happens because 2025 is using https://schemas.wp.org/wp/6.7/theme.json, but that error is gone if I update to use https://schemas.wp.org/trunk/theme.json.
Yes, textInput will not be allowed unless you reference the latest schema (trunk/theme.json).
#8
@
4 months ago
- Keywords gutenberg-merge added
- Milestone changed from Awaiting Review to 6.9
This ticket is a backport from Gutenberg and should be addressed in the 6.9 release.
#9
@
3 months ago
- Owner set to scruffian
- Resolution set to fixed
- Status changed from new to closed
In 61023:
#12
@
3 months ago
Hi @scruffian @cbravobernal - I was not included in the props for testing here which I believe is a mistake 😅. Can you please add missed props?
#14
@
3 months ago
- Resolution fixed deleted
- Status changed from closed to reopened
It has been reported that this feature does not work in 6.9 Beta1.
- https://github.com/WordPress/gutenberg/pull/70378#issuecomment-3431677898
- https://github.com/WordPress/gutenberg/issues/72568
The patch should have been committed via [61023] or [61024], but the change doesn't seem to be reflected. Let's see what's going on.





Trac ticket: https://core.trac.wordpress.org/ticket/63878