Bug 1902761 - Current tab on the Tab Strip announces its current / selected state with TalkBack r=android-reviewers,007

Differential Revision: https://phabricator.services.mozilla.com/D214448
This commit is contained in:
Nicholas Poon 2024-07-03 22:18:00 +00:00
parent 08bf814646
commit e9a04e1dc8

View File

@ -46,6 +46,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.role
import androidx.compose.ui.semantics.selected
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.tooling.preview.Devices
import androidx.compose.ui.tooling.preview.Preview
@ -293,6 +294,7 @@ private fun TabItem(
.clickable { onSelectedTabClick(state.id) }
.semantics {
role = Role.Tab
selected = state.isSelected
},
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,