Skip to content

Commit 11280e0

Browse files
Fix workaround in Segmented control by resetting SelectedIndex during template application (#699)
This commit modifies the `OnApplyTemplate` method in the `Segmented` class to set `SelectedIndex` to `-1` and then assign `_internalSelectedIndex` if `_hasLoaded` is false. This ensures the selected index is reset before applying the internal selection and marks the template as loaded. Co-authored-by: Arlo <arlo.godfrey@outlook.com>
1 parent ec390b9 commit 11280e0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

components/Segmented/src/Segmented/Segmented.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ protected override void OnApplyTemplate()
3939
base.OnApplyTemplate();
4040
if (!_hasLoaded)
4141
{
42+
SelectedIndex = -1;
4243
SelectedIndex = _internalSelectedIndex;
4344
_hasLoaded = true;
4445
}

0 commit comments

Comments
 (0)