Skip to content

SegmentedControl - fixed Outline sometimes renders as a line #3099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 28, 2024

Conversation

nitzanyiz
Copy link
Collaborator

Description

The SegmentedControl outline sometimes renders a straight line and doesn't cover entire segment. Changed the height dimension on the outline to also be a shared value.

Changelog

SegmentedControl - Fix outline sometimes renders as a straight line.

Additional info

MADS-4246

@nitzanyiz nitzanyiz requested a review from Inbal-Tish May 28, 2024 08:13
@nitzanyiz nitzanyiz marked this pull request as ready for review May 28, 2024 08:13
@@ -138,8 +135,8 @@ const SegmentedControl = (props: SegmentedControlProps) => {
const animatedSelectedIndex = useSharedValue(initialIndex);
const segmentsStyle = useSharedValue([] as {x: number; width: number}[]);
// const shouldResetOnDimensionsOnNextLayout = useRef(false); // use this flag if there bugs with onLayout being called more than once.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we remove all the code related to 'shouldResetOnDimensionsOnNextLayout'?

@Inbal-Tish
Copy link
Collaborator

@nitzanyiz Looks good. Just a small note o the commented code

@Inbal-Tish Inbal-Tish assigned nitzanyiz and unassigned Inbal-Tish May 28, 2024
@Inbal-Tish Inbal-Tish changed the title fixed Outline sometimes renders as a line SegmentedControl - fixed Outline sometimes renders as a line May 28, 2024
@Inbal-Tish Inbal-Tish assigned Inbal-Tish and unassigned nitzanyiz May 28, 2024
@Inbal-Tish Inbal-Tish merged commit 48ffdc9 into master May 28, 2024
1 check passed
@Inbal-Tish Inbal-Tish deleted the fix/SegmentedControlOutline branch May 28, 2024 08:48
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