NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

input is not disabled when wrapped in formcontrol

Open ghost opened this issue 2 years ago • 8 comments

No### Description

I expect the input to be disabled when wrapped in a formcontrol

Steps to reproduce

project with dependencies

"native-base": "^3.4.16",
"react": "18.2.0",
"react-hook-form": "^7.43.5",
"react-native": "0.71.0",
"react-native-safe-area-context": "^3.3.2",

nodejs v18.14.2 macos ventura 13.2.1

NativeBase Version

3.4.16

Platform

  • [x] Android
  • [x] iOS

ghost avatar Mar 10 '23 22:03 ghost

+1. When select is wrap with forum on android, it also isn't disabled.

JosephLu2022 avatar Mar 13 '23 23:03 JosephLu2022

+1. Quando o select é agrupado com o fórum no Android, ele também não é desativado.

I got around this with isReaonly and isDisabled at the same time

ghost avatar Mar 14 '23 03:03 ghost

Thanks. I got a work around with isReadOnly on forumcontrol that solves the problem that select is editable on android when wrapped with forumcontrol

JosephLu2022 avatar Mar 15 '23 14:03 JosephLu2022

This is indeed an issue on Android. Works fine on iOS. I should not have to make the FormControl readOnly in order to get this to work on Android only.

Doesn't work:

 <FormControl>
        <Select
          ....
        />
  </FormControl>

When pressing the select input: image

Works:

 <FormControl isReadOnly>
        <Select
          ....
        />
  </FormControl>

When pressing the select input: image

JeroenSchrader avatar Mar 29 '23 11:03 JeroenSchrader

@JeroenSchrader on ios it didn't work for me

ghost avatar Mar 31 '23 06:03 ghost

This is indeed an issue on Android. Works fine on iOS. I should not have to make the FormControl readOnly in order to get this to work on Android only.

Doesn't work:

 <FormControl>
        <Select
          ....
        />
  </FormControl>

When pressing the select input: image

Works:

 <FormControl isReadOnly>
        <Select
          ....
        />
  </FormControl>

When pressing the select input: image

It worked for me in android, did not get to test in IOS.

robertohein avatar Apr 01 '23 19:04 robertohein

worked for me in iOS too

karthikNAS avatar Apr 20 '23 09:04 karthikNAS

its working fine like this Nativebase latest version

<FormControl style={styles.input} isReadOnly={true} isInvalid={'buildingNoError' in errors}> <FormControl.Label>Flat/Shop No</FormControl.Label> <Input type='text' value={unitDetails?.flat_shop_no} /> {'buildingNoError' in errors ? <FormControl.ErrorMessage>{errors.buildingNoError}</FormControl.ErrorMessage> : '' } </FormControl>

mcanikhilprajapati avatar Aug 06 '24 15:08 mcanikhilprajapati