Skip to content

Commit

Permalink
TextField - Increase hitslop (#3504)
Browse files Browse the repository at this point in the history
* Increased hitslop by 20 to top and bottom
  • Loading branch information
nitzanyiz authored Feb 20, 2025
1 parent 3b8c072 commit cc80598
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 0 deletions.
126 changes: 126 additions & 0 deletions demo/src/screens/__tests__/__snapshots__/TextFieldScreen.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -632,6 +638,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -1166,6 +1178,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={false}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -1527,6 +1545,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -1752,6 +1776,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -2111,6 +2141,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -2420,6 +2456,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -2979,6 +3021,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onChangeValidity={[Function]}
Expand Down Expand Up @@ -3317,6 +3365,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
maxLength={20}
onBlur={[Function]}
onChangeText={[Function]}
Expand Down Expand Up @@ -3739,6 +3793,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -4161,6 +4221,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
maxLength={20}
multiline={true}
onBlur={[Function]}
Expand Down Expand Up @@ -4484,6 +4550,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -4776,6 +4848,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
keyboardType="numeric"
onBlur={[Function]}
onChangeText={[Function]}
Expand Down Expand Up @@ -5092,6 +5170,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -5825,6 +5909,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -6119,6 +6209,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -6442,6 +6538,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -6811,6 +6913,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -7085,6 +7193,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -7334,6 +7448,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -7599,6 +7719,12 @@ exports[`TextField Screen renders screen 1`] = `
}
}
editable={true}
hitSlop={
{
"bottom": 20,
"top": 20,
}
}
onBlur={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
Expand Down
1 change: 1 addition & 0 deletions src/components/textField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ const TextField = (props: InternalTextFieldProps) => {
/>
)}
<Input
hitSlop={{top: 20, bottom: 20}}
placeholderTextColor={hidePlaceholder ? 'transparent' : placeholderTextColor}
value={fieldState.value}
{...others}
Expand Down

0 comments on commit cc80598

Please sign in to comment.