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

Feat: Fix radiobuttongroup inse referenceInput #8214

Closed
wants to merge 1 commit into from

Conversation

arimet
Copy link
Contributor

@arimet arimet commented Sep 30, 2022

radiobutton.mp4

@arimet arimet self-assigned this Sep 30, 2022
@@ -125,7 +125,10 @@ export const useReferenceInputController = <RecordType extends RaRecord = any>(
finalData = possibleValuesData;
finalTotal = total;
} else {
finalData = [referenceRecord, ...possibleValuesData];
finalData = [...possibleValuesData];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only solution I have found for now.

During a short time, referenceRecord becomes the selected value in the radio group.
So we have a finalData with a duplicate.

I will add it in two steps with a check to avoid the rendering jump

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had tried this technique, but it creates a "flick" when rendering the component.

flickrendering.mp4

@@ -125,7 +125,10 @@ export const useReferenceInputController = <RecordType extends RaRecord = any>(
finalData = possibleValuesData;
finalTotal = total;
} else {
finalData = [referenceRecord, ...possibleValuesData];
finalData = [...possibleValuesData];
Copy link
Member

Choose a reason for hiding this comment

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

@fzaninotto
Copy link
Member

Superseded by #8229

@fzaninotto fzaninotto closed this Oct 4, 2022
@fzaninotto fzaninotto deleted the fix-radio-button branch August 9, 2023 15:10
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.

2 participants