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

Add readonly & required data attributes to <TextField /> #5964

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

sookmax
Copy link
Contributor

@sookmax sookmax commented Feb 28, 2024

Closes #5930

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Docs

http://localhost:1234/react-aria/TextField.html#textfield-2

🧢 Your Project:

@reidbarber
Copy link
Member

GET_BUILD

@stefanprobst
Copy link
Contributor

thanks! should we add these to NumberField/DateField/Select as well?

@rspbot
Copy link

rspbot commented Feb 28, 2024

@rspbot
Copy link

rspbot commented Feb 28, 2024

## API Changes

unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These seem like they should be renderProps for the Input as well. Thoughts?

If we want to do that, it can be in a separate PR

@snowystinger snowystinger merged commit bc50898 into adobe:main Feb 28, 2024
27 checks passed
@sookmax
Copy link
Contributor Author

sookmax commented Mar 1, 2024

@snowystinger Not sure if <Input /> can be used standalone, but I found the following test in TextField.test.js:

it('should render data- attributes only on the outer element', () => {
let {getAllByTestId} = render(<TestTextField input={component} />);
let outerEl = getAllByTestId('text-field-test');
expect(outerEl).toHaveLength(1);
expect(outerEl[0]).toHaveClass('react-aria-TextField');
});

Title of which, by the way, doesn't seem to match what it is testing?

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

Successfully merging this pull request may close these issues.

[RAC] Add data-required and data-readonly attributes to form components
5 participants