Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On click on 1st textField, cursor shows up on next textfield when 2 textfields are in row. #48

Open
bhavinatharva opened this issue Jul 14, 2022 · 5 comments

Comments

@bhavinatharva
Copy link

bhavinatharva commented Jul 14, 2022

two FilledTextField in a row, focusing 2nd one not the first one

 focusable={false}
autoFocus={false}
autoCorrect={false}

these properties are also not working for the same

 <View
          style={[
            styles.container,
            this.state.hasFocus ? styles.active : null,
            errorMessage ? styles.bottomBorder : null,
          ]}>
          <View key="CountryCode" style={countryCodeStyle}>
            <TouchableOpacity
              onPress={() => onPressCountry()}
              activeOpacity={0.5}>
              <FilledTextField
                {...this.props}
                ref={ref => (this.countryInputRef = ref)}
                key="CountryCode"
                defaultValue={countryCode}
                label={placeholderCode}
                value={countryCode}
                lineWidth={0}
                fontSize={FontsSize.font12}
                labelFontSize={FontsSize.font10}
                inputContainerStyle={[
                  this.state.hasFocus ? styles.inputText : styles.inputTextBlur,
                ]}
                lineType={'none'}
                selectionColor={colors.FROLY}
                labelOffset={{y0: -3}}
                labelTextStyle={styles.labelTextStyle}
                baseColor={colors.COMET}
                tintColor={colors.COMET}
                error={errorMessage}
                onChangeText={text =>
                  handleChangeText(text.replace(/[^0-9]/g, ''))
                }
                onFocus={this.onFocusCountryCode}
                onBlur={this.onBlurCountryCode}
                titleTextStyle={styles.labelTextStyle}
                disabledLineWidth={0}
                editable={false}
                keyboardType="numeric"
              />
            </TouchableOpacity>
            <View style={{position: 'absolute', end: 0}}>
              <TouchableOpacity onPress={() => onPressCountry()}>
                <Image
                  source={Assets.ic_down_arrow}
                  style={styles.selectIcon}
                />
              </TouchableOpacity>
            </View>
          </View>

          <View
            key="MobileNumber"
            style={{flex: 0.8}}
            focusable={false}
            onStartShouldSetResponder={() => false}>
            <FilledTextField
              key="MobileNumber"
              {...this.props}
              ref={ref => (this.inputRef = ref)}
              label={label}
              value={value}
              lineWidth={0.5}
              fontSize={FontsSize.font12}
              labelFontSize={FontsSize.font10}
              inputContainerStyle={[
                this.state.hasFocus ? styles.inputText : styles.inputTextBlur,
              ]}
              lineType={'none'}
              pointerEvents={pointerEvent}
              selectionColor={colors.FROLY}
              labelOffset={{y0: -3}}
              labelTextStyle={styles.labelTextStyle}
              baseColor={colors.COMET}
              tintColor={colors.COMET}
              error={errorMessage}
              onChangeText={text =>
                handleChangeText(text.replace(/[^0-9]/g, ''))
              }
              onFocus={this.onFocusCallback}
              onBlur={this.onBlurBack}
              titleTextStyle={styles.labelTextStyle}
              editable={isEditable}
              keyboardType="numeric"
            />
          </View>
        </View>

Demo : https://www.loom.com/share/647d830245e147de9ab0c75a2d376cb7

@gabrieldonadel
Copy link
Owner

@bhavinatharva do you mind sharing a small demo?

@bhavinatharva
Copy link
Author

@catype
Copy link

catype commented Aug 18, 2022

Hi! @gabrieldonadel It is the same issue closed for some reasons, since loom links above seems dead, here you can see the issue.

@catype
Copy link

catype commented Aug 18, 2022

As workaround, you can set different zIndexes for these selects, it works for me

@chromakeeey
Copy link

labelTextStyle={{
  position: 'absolute',
  left: '100%'
}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants