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

fix: input problem on appointment creation on safari #322

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

LomyW
Copy link
Contributor

@LomyW LomyW commented Aug 9, 2023

Description

We had the problem, that only a single character is accepted on controlled input.
So it seems that the problem occures when a select element is present with an input on the same page.
refers to https://github.com/corona-school/project-user/issues/853

Solved

  • create custom select component

@LomyW LomyW requested a review from timidak August 9, 2023 09:06
@LomyW LomyW self-assigned this Aug 9, 2023
@Jonasdoubleyou Jonasdoubleyou temporarily deployed to user-app-fix-create-app-lyy02s August 9, 2023 09:06 Inactive
@@ -138,7 +139,7 @@ const AppointmentForm: React.FC<FormProps> = ({ errors, appointmentsCount, onSet
{/* DURATION */}
<FormControl isInvalid={'duration' in errors} width={inputWidth}>
<FormControl.Label>{t('appointment.create.durationLabel')}</FormControl.Label>
<Select placeholder="Dauer der Unterrichtseinheit" onValueChange={(e) => handleDurationSelection(e)}>
<Select placeholder="Dauer der Unterrichtseinheit" onValueChange={(duration: string) => handleDurationSelection(duration)}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did this even work before? 😅

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this hack come from? Could you add a comment, cause I do not understand how it works?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I found the same issue here: GeekyAnts/NativeBase#5111
And the solution therefore is: https://github.com/spr-networks/super/blob/main/frontend/src/components/Select.web.js
I honestly cant explain to you how it works... 😅

@Jonasdoubleyou Jonasdoubleyou temporarily deployed to user-app-fix-create-app-lyy02s August 10, 2023 05:14 Inactive
@LomyW LomyW merged commit 6a3edcc into main Aug 10, 2023
2 checks passed
@LomyW LomyW deleted the fix/create-appointment-input-on-safari branch August 10, 2023 06:33
dhenkel92 added a commit that referenced this pull request Aug 10, 2023
…ment-input-on-safari"

This reverts commit 6a3edcc, reversing
changes made to fbccaa2.
dhenkel92 added a commit that referenced this pull request Aug 10, 2023
Revert "Merge pull request #322 from corona-school/fix/create-appoint…
@LomyW LomyW restored the fix/create-appointment-input-on-safari branch August 11, 2023 05:18
@Jonasdoubleyou Jonasdoubleyou deleted the fix/create-appointment-input-on-safari branch August 21, 2023 10:20
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

Successfully merging this pull request may close these issues.

2 participants