Skip to content

Conversation

blazejkustra
Copy link
Contributor

@blazejkustra blazejkustra commented Jan 13, 2025

Description

Simplification of layout synchronization:

  • Removed the rightOffset shared value and the associated updateRightElementWidth function, which were used for synchronizing layout measurements between JS and UI.

Handling of right element width:

  • Updated the rightElement callback to directly set the rightWidth value based on the layout width of the right actions container.
  • Added a new style rightActionsContainer to ensure the correct flex direction for the right actions container.

Test plan

Test if swipeable works well on web after window resize

Copy link
Member

@latekvo latekvo left a comment

Choose a reason for hiding this comment

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

Works great, just a few minor requests

@blazejkustra blazejkustra marked this pull request as ready for review January 14, 2025 14:44
@blazejkustra blazejkustra requested a review from latekvo January 14, 2025 14:44
Copy link
Member

@latekvo latekvo left a comment

Choose a reason for hiding this comment

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

It seems these changes brake the right action of GmailStyleSwipeableRow in the New Swipeable example in the New api section of our example app.

I think this may be caused by rightWidth.value being updated only in onLayout which might be loaded too early to read the panel width.
Previously it was updated multiple times using the updateRightElementWidth() function.
As far as I remember, this was done to fix non-deterministic element loading.

@latekvo
Copy link
Member

latekvo commented Jan 24, 2025

Fixed in #3341

@latekvo latekvo closed this Jan 24, 2025
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