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

fix: ra inputs outside <Form> need a SourceContext #9944

Merged
merged 5 commits into from
Jun 24, 2024

Conversation

adguernier
Copy link
Contributor

Problem

Inputs outside a <Form> now need a SourceContext but sometimes we need to use ra inputs outside a form

Solution

Provide a default SourceContext

@adguernier adguernier added the RFR Ready For Review label Jun 21, 2024
Copy link
Member

@fzaninotto fzaninotto left a comment

Choose a reason for hiding this comment

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

As this is the purpose of this PR, could you please add a story and a unit test showing that TextInput works inside a simple <form> tag?

import { Form } from '../form';

export default {
title: 'ra-core/core/SourceContext',
Copy link
Member

Choose a reason for hiding this comment

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

I'd move it to the TextInput story. It doesn't make sense to tests a ra-ui-mui component inside ra-core.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just use a custom TextInput like in ReferenceInputBase.stories.tsx

@djhi djhi added this to the 5.0.2 milestone Jun 24, 2024
@djhi djhi changed the base branch from next to master June 24, 2024 08:31
@djhi djhi merged commit 0b3f840 into master Jun 24, 2024
14 checks passed
@djhi djhi deleted the provide-a-default-source-context branch June 24, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants