Disable grid control strategies for components which don't support style props #6610
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.
Problem:
Now it is possible to use the gap and the grid resize controls on components which do not support style props.
Fix:
We somehow have to decide whether a component supports style props or not. I implemented the following heuristics, but we can improve that later if necessary:
targetSupportsPropsSize
function). This returns true when the component implementation can not be found (if it is an external component)Note: When the component does not support the necessary style props:
These are just draft solution, so a followup task is necessary to design/implement the the non-interactive state of the controls
Commit Details: (< vv pls delete this section if's not relevant)
-
targetRegisteredStyleControlsOrHonoursStyleProps
is the main function which decides whether a component supports style props for the actual control. You can give an inspector section to check (if that is enabled from the annotation, it returns true), and a list of props (if they are referred inside the component we return true).Manual Tests:
I hereby swear that: