Skip to content

Internal: Prevent the indications popover from opening in the Repeaters controls [ED-20023]#31844

Merged
elchugreeva merged 18 commits intoelementor:mainfrom
elchugreeva:ED-20023-prevent-the-indications-popover-from-opening-in-the-repeaters-controls
Jul 14, 2025
Merged

Internal: Prevent the indications popover from opening in the Repeaters controls [ED-20023]#31844
elchugreeva merged 18 commits intoelementor:mainfrom
elchugreeva:ED-20023-prevent-the-indications-popover-from-opening-in-the-repeaters-controls

Conversation

@elchugreeva
Copy link
Copy Markdown
Contributor

@elchugreeva elchugreeva commented Jul 14, 2025

✨ PR Description

Purpose: Prevent indications popover from opening in specific Repeaters controls by adding conditional filtering logic.
Main changes:

  • Added skipControls array containing control types to exclude from the inheritance indicator
  • Moved isUsingNestedProps constant outside component for better performance
  • Enhanced conditional check to filter out specified control types from inheritance chain

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using. We'd love your feedback! 🚀

mike-elementor
mike-elementor previously approved these changes Jul 14, 2025
export const StylesInheritanceIndicator = () => {
const { path, propType } = useBoundProp();

const skipControls = [ 'box-shadow', 'background-overlay', 'filter', 'backdrop-filter', 'transform' ];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 ) ) ) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?)

const inheritanceChain = useStylesInheritanceChain( finalPath );

if ( ! inheritanceChain.length ) {
if ( ! path || path.some( ( pathItem ) => skipControls.includes( pathItem ) ) || ! inheritanceChain.length ) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

@elchugreeva elchugreeva marked this pull request as ready for review July 14, 2025 14:26
gitstream-cm[bot]

This comment was marked as resolved.

@elchugreeva elchugreeva merged commit 3c333b2 into elementor:main Jul 14, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants