fix: x axis title disappears when editing bar chart #30821
+27
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #30370
SUMMARY
The
createAxisTitleControl
andcreateAxisControl
functions use thevisibility
prop to hide controls. This caused an issue where controls with duplicate names were stashed from the form data if one of them hadvisibility
set tofalse
and was rendered later than the visible one.Solution
To resolve this, I introduced a new prop
disableStash
, to theControl
component, which prevents stashing for the control where it is applied.Additionally, I set the
resetOnHide
prop tofalse
to prevent the axis titles from disappearing on the chart when changing the orientation.Hidden prop bug
Initially, I considered replacing
visibility
with ahidden
prop in the Bar chart controls. However, this approach led to issues with refreshing hidden control values and I decided to keep thevisibility
prop for a less invasive change.While working with the
hidden
prop, I discovered a bug where{...restProps}
overwrote thehidden
prop's intended value, so() => false
value was hiding the control. I plan to address this in a separate issue. The first commit reflects this initial approach, but I reverted it in the following commit to keep this PR focused on thevisibility
prop anddisableStash
solution.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
Kapture.2024-11-02.at.11.31.45.mp4
After
Kapture.2024-11-02.at.10.48.54-2.mp4
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION