Internal: Prevent the indications popover from opening in the Repeaters controls [ED-20023]#31844
Conversation
* print user-defined names in kit css * print user-defined names in prop-type transformers * fixed tests
…rs controls [ED-20023]
…m-opening-in-the-repeaters-controls
| export const StylesInheritanceIndicator = () => { | ||
| const { path, propType } = useBoundProp(); | ||
|
|
||
| const skipControls = [ 'box-shadow', 'background-overlay', 'filter', 'backdrop-filter', 'transform' ]; |
There was a problem hiding this comment.
Const that is not going to change no matter what is the input should be move to file level (after imports)
The reason is that whenever you are calling StylesInheritanceIndicator, it will recreate the array each time, which is memory-consuming, and we prefer to avoid
This is the same as you are importing the EXPERIMENTAL_FEATURES, it is a block list that is declared once and always used the same
|
|
||
| const inheritanceChain = useStylesInheritanceChain( finalPath ); | ||
|
|
||
| if ( path.some( ( pathItem ) => skipControls.includes( pathItem ) ) ) { |
There was a problem hiding this comment.
You can unify the checks with line 35 as they are returning the same (also, don't you want to validate that the path is not undefined?)
…m-opening-in-the-repeaters-controls
…m-opening-in-the-repeaters-controls
…m-opening-in-the-repeaters-controls
| const inheritanceChain = useStylesInheritanceChain( finalPath ); | ||
|
|
||
| if ( ! inheritanceChain.length ) { | ||
| if ( ! path || path.some( ( pathItem ) => skipControls.includes( pathItem ) ) || ! inheritanceChain.length ) { |
There was a problem hiding this comment.
this is a bit hard to read/digest (support in the future)
can we do a slight split:
if ( noInheritance() || nonSupportedControl() ) {
return null;
}
so that maybe, it will be easier to read/update later on...
wdyt?
…m-opening-in-the-repeaters-controls
…m-opening-in-the-repeaters-controls
…m-opening-in-the-repeaters-controls
✨ PR Description
Purpose: Prevent indications popover from opening in specific Repeaters controls by adding conditional filtering logic.
Main changes:
Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using. We'd love your feedback! 🚀