Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f56313b
feat(text-input): add `<pf-v6-text-input>`
zeroedin Aug 12, 2026
75b87f0
fix(core): expose `form`, `validationMessage`, `willValidate` on Inte…
zeroedin Aug 12, 2026
387174f
fix(text-input): use InternalsController getters for form and validat…
zeroedin Aug 12, 2026
db6abe4
test(text-input): add tests
zeroedin Aug 12, 2026
2a92cb8
chore: add changesets
zeroedin Aug 12, 2026
8d1fdbc
docs(text-input): add docs page
zeroedin Aug 12, 2026
5553867
docs(text-input): improve comments
zeroedin Aug 18, 2026
a646628
fix(tools): add typings for invalid and readonly for Allysnapshot
zeroedin Aug 20, 2026
5daeb65
chore(tools): add changeset
zeroedin Aug 20, 2026
b6258d5
fix(text-input): dispatch non-cancelable change event
bennypowers Oct 12, 2026
67211d0
fix(text-input): restore initial value on form reset
bennypowers Oct 12, 2026
e361675
fix(text-input): input validation
bennypowers Oct 12, 2026
f338c70
refactor(text-input): remove referenceTarget pending browser support
bennypowers Oct 12, 2026
25fe2da
fix(text-input): drop redundant aria-live on alert role
bennypowers Oct 12, 2026
afc4224
fix(text-input): hide svg icons from assistive technology
bennypowers Oct 12, 2026
4355257
docs(text-input): rename invalid demo legend to Snowboards
bennypowers Oct 12, 2026
77a3113
chore(text-input): update changeset
zeroedin Oct 20, 2026
46373ff
docs(text-input): hide decorative SVGs from assistive technology
zeroedin Oct 20, 2026
6df197d
fix(text-input): prevent form submission when Enter confirms composed…
zeroedin Oct 20, 2026
f26aae3
feat(text-input): add declarative error-text validation
zeroedin Oct 20, 2026
b4c104b
feat(text-input): support browser autocomplete
zeroedin Oct 20, 2026
d1c128e
fix(text-input): make validated error fail constraint validation
zeroedin Oct 20, 2026
564c7ed
fix(text-input): apply disabled background to host
zeroedin Oct 20, 2026
93b1543
fix(text-input): keep truncated text visible on focus
zeroedin Oct 20, 2026
150c3aa
fix(text-input): prevent scrolling truncated preview before focus
zeroedin Oct 20, 2026
2e67849
fix(text-input): clear stale server errors when the value changes
zeroedin Oct 20, 2026
6f4faa5
fix(text-input): handle validity for disabled and readonly fields
zeroedin Oct 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/a11y-snapshot-form-states.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@patternfly/pfe-tools": patch
---

Added `readonly` and `invalid` properties to a11y snapshot type
5 changes: 5 additions & 0 deletions .changeset/quick-shoes-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@patternfly/pfe-core": patch
---

`InternalsController`: expose `form`, `validationMessage`, and `willValidate` getters. Previously returned `undefined` despite TypeScript accepting the access. Form-associated elements can read the associated form reference and validation state from the controller.
31 changes: 31 additions & 0 deletions .changeset/warm-birds-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
"@patternfly/elements": major
---

`<pf-v6-text-input>`: replaces `<pf-v5-text-input>` with PatternFly v6 design specs.

```html
<label for="name">Name</label>
<pf-v6-text-input id="name" name="name"></pf-v6-text-input>
```

**Breaking Changes from v5**

- Renamed tag from `<pf-v5-text-input>` to `<pf-v6-text-input>`
- CSS custom properties renamed from `--pf-v5-c-form-control--*` to `--pf-v6-c-form-control--*`
- `left-truncated` attribute replaced by `truncated="start"` enum
- `icon` / `custom-icon-url` / `custom-icon-dimensions` attributes replaced by `icon` slot
- `validate-on` attribute removed; `error-text` now supplies the custom error for `validated="error"`, instead of replacing an existing validation message

**New features**

- `validated="error"` state with error styling and `aria-invalid`, without changing browser validity by itself
- Declarative `error-text` custom error for `validated="error"`, announced through a `role="alert"` status message; both attributes clear when the value changes
- Constraint validation via `checkValidity()`, `reportValidity()`, `setCustomValidity()`
- `autocomplete` attribute forwarded to the inner input, with browser-autocompleted values restored to form state
- `maxlength`, `minlength`, and `inputmode` attributes
- `select()` method
- `icon` slot for custom icon content
- Bubbling, non-cancelable `change` event re-dispatched from the host
- Enter-to-submit ignores Enter while text is being composed
- v6 design tokens and `light-dark()` support
15 changes: 12 additions & 3 deletions core/pfe-core/controllers/internals-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,10 @@ type InternalsHost = ReactiveControllerHost & HTMLElement;
export class InternalsController implements ReactiveController, ARIAMixin {
private static instances = new WeakMap<HTMLElement, InternalsController>();

declare readonly form: ElementInternals['form'];
declare readonly shadowRoot: ElementInternals['shadowRoot'];

// https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states
declare readonly states: unknown;
declare readonly willValidate: ElementInternals['willValidate'];
declare readonly validationMessage: ElementInternals['validationMessage'];

public static getLabels(host: InternalsHost): Element[] {
return Array.from(this.instances.get(host)?.internals.labels ?? []) as Element[];
Expand Down Expand Up @@ -232,6 +229,18 @@ export class InternalsController implements ReactiveController, ARIAMixin {
return this.internals.validity;
}

get form(): HTMLFormElement | null {
return this.internals.form;
}

get validationMessage(): string {
return this.internals.validationMessage;
}

get willValidate(): boolean {
return this.internals.willValidate;
}

/** A best-attempt based on observed behaviour in FireFox 115 on fedora 38 */
get computedLabelText(): string {
return this.internals.ariaLabel
Expand Down
2 changes: 1 addition & 1 deletion docs/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import '@patternfly/elements/pf-v5-select/pf-v5-select.js';
import '@patternfly/elements/pf-v5-table/pf-v5-table.js';
import '@patternfly/elements/pf-v5-tabs/pf-v5-tabs.js';
import '@patternfly/elements/pf-v5-text-area/pf-v5-text-area.js';
import '@patternfly/elements/pf-v5-text-input/pf-v5-text-input.js';
import '@patternfly/elements/pf-v6-text-input/pf-v6-text-input.js';
import '@patternfly/elements/pf-v5-tile/pf-v5-tile.js';
import '@patternfly/elements/pf-v5-tooltip/pf-v5-tooltip.js';

Expand Down
9 changes: 0 additions & 9 deletions elements/pf-v5-text-input/README.md

This file was deleted.

24 changes: 0 additions & 24 deletions elements/pf-v5-text-input/demo/form-submission.html

This file was deleted.

23 changes: 0 additions & 23 deletions elements/pf-v5-text-input/demo/icon-variants.html

This file was deleted.

12 changes: 0 additions & 12 deletions elements/pf-v5-text-input/demo/index.html

This file was deleted.

14 changes: 0 additions & 14 deletions elements/pf-v5-text-input/demo/invalid.html

This file was deleted.

81 changes: 0 additions & 81 deletions elements/pf-v5-text-input/demo/kitchen-sink.html

This file was deleted.

11 changes: 0 additions & 11 deletions elements/pf-v5-text-input/demo/left-truncated.html

This file was deleted.

18 changes: 0 additions & 18 deletions elements/pf-v5-text-input/demo/read-only.html

This file was deleted.

38 changes: 0 additions & 38 deletions elements/pf-v5-text-input/demo/status-icon-sprite.svg

This file was deleted.

26 changes: 0 additions & 26 deletions elements/pf-v5-text-input/demo/validation.html

This file was deleted.

23 changes: 0 additions & 23 deletions elements/pf-v5-text-input/docs/pf-v5-text-input.md

This file was deleted.

Binary file removed elements/pf-v5-text-input/docs/screenshot.png
Binary file not shown.
Loading
Loading