Skip to content

Commit eae3915

Browse files
protikbiswas100Protik Biswas
andauthored
fixing truncation issue on scaling to 200% (#640)
* fixing truncation issue on scaling to 200% * updating snapshot * updating snapshot again * 3. updating snapshot * 4. updating snapshot * 5. updating snapshot --------- Co-authored-by: Protik Biswas <protikbiswas100@microsoft.com>
1 parent 299c4e6 commit eae3915

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

NewArch/src/examples/PressableExamplePage.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,10 @@ export const PressableExamplePage: React.FunctionComponent<{navigation?: any}> =
155155
: Platform.OS === 'windows'
156156
? PlatformColor('SystemColorButtonFaceColor')
157157
: 'silver',
158-
width: 140,
159-
height: 50,
158+
padding: 8,
159+
minWidth: 140,
160+
alignItems: 'center',
161+
justifyContent: 'center',
160162
borderRadius: 2,
161163
},
162164
]}>
@@ -165,6 +167,7 @@ export const PressableExamplePage: React.FunctionComponent<{navigation?: any}> =
165167
style={{
166168
textAlign: 'center',
167169
paddingVertical: 15,
170+
flexWrap: 'wrap',
168171
color: pressed ? '#FFFFFF' : colors.text,
169172
}}>
170173
{pressed ? `Pressed ${timesPressed} times!` : 'Press Me'}

__tests__/__snapshots__/App-test.js.snap

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27730,14 +27730,16 @@ exports[`Pressable Example Page 1`] = `
2773027730
style={
2773127731
[
2773227732
{
27733+
"alignItems": "center",
2773327734
"backgroundColor": {
2773427735
"windowsbrush": [
2773527736
"SystemColorButtonFaceColor",
2773627737
],
2773727738
},
2773827739
"borderRadius": 2,
27739-
"height": 50,
27740-
"width": 140,
27740+
"justifyContent": "center",
27741+
"minWidth": 140,
27742+
"padding": 8,
2774127743
},
2774227744
]
2774327745
}
@@ -27746,7 +27748,7 @@ exports[`Pressable Example Page 1`] = `
2774627748
style={
2774727749
{
2774827750
"color": "rgb(28, 28, 30)",
27749-
"paddingVertical": 15,
27751+
"flexWrap": "wrap",
2775027752
"textAlign": "center",
2775127753
}
2775227754
}
@@ -28445,16 +28447,13 @@ exports[`Pressable Example Page 1`] = `
2844528447
],
2844628448
},
2844728449
"borderRadius": 2,
28448-
"height": 50,
28449-
"width": 200,
2845028450
}
2845128451
}
2845228452
>
2845328453
<Text
2845428454
style={
2845528455
{
2845628456
"color": "rgb(28, 28, 30)",
28457-
"paddingVertical": 15,
2845828457
"textAlign": "center",
2845928458
}
2846028459
}

src/examples/PressableExamplePage.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,19 @@ export const PressableExamplePage: React.FunctionComponent<{}> = () => {
143143
: Platform.OS === 'windows'
144144
? PlatformColor('SystemColorButtonFaceColor')
145145
: 'silver',
146-
width: 140,
147-
height: 50,
148146
borderRadius: 2,
147+
padding: 8,
148+
minWidth: 140,
149+
alignItems: 'center',
150+
justifyContent: 'center',
149151
},
150152
]}>
151153
{({pressed}) => (
152154
<Text
153155
style={{
154156
textAlign: 'center',
155-
paddingVertical: 15,
156157
color: pressed ? '#FFFFFF' : colors.text,
158+
flexWrap: 'wrap',
157159
}}>
158160
{pressed ? `Pressed ${timesPressed} times!` : 'Press Me'}
159161
</Text>
@@ -170,8 +172,6 @@ export const PressableExamplePage: React.FunctionComponent<{}> = () => {
170172
'click me to see the diffrent events (press, pressIn, pressOut, longPress)'
171173
}
172174
style={{
173-
width: 200,
174-
height: 50,
175175
borderRadius: 2,
176176
backgroundColor:
177177
Platform.OS === 'windows'
@@ -185,7 +185,6 @@ export const PressableExamplePage: React.FunctionComponent<{}> = () => {
185185
<Text
186186
style={{
187187
textAlign: 'center',
188-
paddingVertical: 15,
189188
color: colors.text,
190189
}}>
191190
Most recent event: {currEvent}

0 commit comments

Comments
 (0)