Commit bfa4f35
authored
## Description
On iOS, setting `tapAnimationDuration` on Touchable didn't turn off the
animation entirely, instead making it take 0.25s. CoreAnimation treats
`0` in this case as `not set` and uses the default duration.
This PR adds an explicit check for the `0` duration and applies the end
state immediately for the underlay.
## Test plan
```jsx
<Touchable
style={{
width: 220,
paddingVertical: 20,
borderRadius: 12,
backgroundColor: '#A0D5EF',
alignItems: 'center',
justifyContent: 'center',
overflow: 'hidden',
}}
underlayColor={COLORS.RED}
activeUnderlayOpacity={0.6}
tapAnimationDuration={0}
onPress={() => pushLog('onPress')}>
<Text>Hold me</Text>
</Touchable>
```
1 parent 3dca7f3 commit bfa4f35
1 file changed
Lines changed: 11 additions & 0 deletions
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
| |||
0 commit comments