Skip to content

Change dynamic style events behviour#6555

Merged
artf merged 3 commits intodevfrom
fix-dynamic-style-events
Jul 1, 2025
Merged

Change dynamic style events behviour#6555
artf merged 3 commits intodevfrom
fix-dynamic-style-events

Conversation

@mohamedsalem401
Copy link
Contributor

@mohamedsalem401 mohamedsalem401 commented Jul 1, 2025

Some changes to how style changes, particularly those tied to data sources, trigger events:

  • Enable Event Emission for Data-Bound Styles: Allow events to be emitted when styles even if a style is bound to a data source. This will enable real-time UI updates as the underlying data changes.
  • Emit Events on Data Source Value Changes: When a style's value changes due to an update in its bound data source (e.g., em.Datasource.get('ds').setRecord()), an event like em.emit(change:style:STYLE_NAME) should be emitted. This provides a clear signal that a specific style has been updated.
  • Fix Event Emission for Redundant Data Bindings: An event should still be emitted even when binding a style to a data source with a value that is identical to its previous static value. For example, if cmp.getStyle('width') currently returns '100px' and you then set cmp.setStyle({width: {type: 'data-variable', path: 'some_path.to.100px'}}) (assuming the data variable also resolves to '100px'), an event should still be triggered to indicate the change in binding type, even if the visual outcome is the same.
  • Fix Listening to Data Source Changes After Project Load: Updating values had some bugs if the data source or record was added after the dynamic value was added to components.

Copy link
Member

Choose a reason for hiding this comment

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

👏

@artf artf merged commit a087e94 into dev Jul 1, 2025
3 checks passed
@mohamedsalem401 mohamedsalem401 deleted the fix-dynamic-style-events branch July 1, 2025 11:00
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