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

Select element takes focus from input element on react native web on Safari browser #5111

Open
1 of 5 tasks
jvzTrifork opened this issue Jun 28, 2022 · 13 comments · May be fixed by #5685
Open
1 of 5 tasks

Select element takes focus from input element on react native web on Safari browser #5111

jvzTrifork opened this issue Jun 28, 2022 · 13 comments · May be fixed by #5685

Comments

@jvzTrifork
Copy link

jvzTrifork commented Jun 28, 2022

Description

Only a single character is accepted on controlled input when a Select element is present

CodeSandbox/Snack link

https://snack.expo.dev/MOBQ7fNEN

Steps to reproduce

  1. On Safari browser
  2. In Expo snack, type a letter in input component - shows up
  3. Type another letter - It doesn't show up

NativeBase Version

3.4.7

Platform

  • Android
  • CRA
  • Expo
  • iOS
  • Next

Other Platform

Web - Safari

Additional Information

I think it is the internal input element of a Select element which takes focus.

@Krithikj20
Copy link
Collaborator

Hi @jvzTrifork, Thank you for reporting this issue. We will look into it.

@himgodfreyho
Copy link

Hi there. We have the exact same problem. Do you have any workarounds? Or when will it be updated? We have a big form and lots of Safari users...but changing it to another Select element is painful...

@jvzTrifork
Copy link
Author

We ended up downgrading to version 3.4.6 which does not have this bug.

@CasuallyCaffeinated
Copy link

Any update on this issue?

@josephtannenbaum
Copy link

Also experiencing this, version 3.4.19. Does anyone know of a compatible Select element for a replacement?

@DPflasterer
Copy link

Also experiencing this. Has there been any progress made on this issue?

@omigueis
Copy link

omigueis commented Feb 7, 2023

Any update?

@gfviegas
Copy link

gfviegas commented Mar 1, 2023

We have this issue too. I'd appreciate any workaround or fix, or even suggestions to other select libraries.

@Krithikj20

@gfviegas
Copy link

gfviegas commented Mar 1, 2023

After some digging, I've found out the reason is the prop selection in the commonInput rendered on the Select component. After cloning the select component inside my project and removing this prop (which is extracted in nonLayoutProps) the bug goes away.

Also, the component works just fine without this prop. Perhaps it should be added only on safari on web.

gfviegas added a commit to gfviegas/NativeBase that referenced this issue Mar 1, 2023
@gfviegas gfviegas linked a pull request Mar 1, 2023 that will close this issue
@CyanoFresh
Copy link

not only on Safari, mobile Chrome also has this issue. Any update?

@lts-rad
Copy link

lts-rad commented Jun 29, 2023

@lts-po and I made a work around in our codebase for this issue by creating two custom components that inherit Select.

The first is basically a no-op but needs to wrap Select from native-base
https://github.com/spr-networks/super/blob/main/frontend/src/components/Select.js

The second is for the web clients
https://github.com/spr-networks/super/blob/main/frontend/src/components/Select.web.js

Here is the implementation

import React from 'react'

import { Select as NBSelect } from 'native-base'


const Select = (props) => {
  const isSafari = () =>
    /Safari/.test(navigator.userAgent) &&
    /Apple Computer/.test(navigator.vendor);


  return (
    <NBSelect {...props} selection={isSafari() ? 1 : null}/>
  );
};

Select.Item = NBSelect.Item
export default Select
export { Select }

@robbporto
Copy link

Mobile Chrome for iOS has the same issue.

@NamorNimash
Copy link

Mobile Chrome for iOS has the same issue.

Yes confirm. Maybe this problem has disappeared in Glustack-ui?

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

Successfully merging a pull request may close this issue.