Skip to content

fix: remove label/image from segment if they are mutated to null#17323

Merged
MarshallOfSound merged 1 commit intomasterfrom
fix-segmented-control-update
Mar 11, 2019
Merged

fix: remove label/image from segment if they are mutated to null#17323
MarshallOfSound merged 1 commit intomasterfrom
fix-segmented-control-update

Conversation

@MarshallOfSound
Copy link
Member

Description of Change

The way we manage segmented controls is mutating them in place to match the new properties. This had issues when "label" or "image" wasn't just changed, rather completely removed / reset to null.

This PR updates the logic to handle the null/undefined cases.

Fixes #17322

Notes: TouchBarSegmentedControl instances now correctly update when you update the segments array and remove label or image dynamically.

Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

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

i wish there was a way to test this but logically it looks sound!

@MarshallOfSound MarshallOfSound merged commit c7a4532 into master Mar 11, 2019
@release-clerk
Copy link

release-clerk bot commented Mar 11, 2019

Release Notes Persisted

TouchBarSegmentedControl instances now correctly update when you update the segments array and remove label or image dynamically.

@MarshallOfSound MarshallOfSound deleted the fix-segmented-control-update branch March 11, 2019 18:13
@trop
Copy link
Contributor

trop bot commented Mar 11, 2019

I have automatically backported this PR to "5-0-x", please check out #17334

@trop
Copy link
Contributor

trop bot commented Mar 11, 2019

I have automatically backported this PR to "4-0-x", please check out #17335

@trop
Copy link
Contributor

trop bot commented Mar 11, 2019

I have automatically backported this PR to "3-1-x", please check out #17336

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