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

mWeb - Assign Task Description field shows as multiline #21433

Closed
1 of 6 tasks
kavimuru opened this issue Jun 23, 2023 · 9 comments
Closed
1 of 6 tasks

mWeb - Assign Task Description field shows as multiline #21433

kavimuru opened this issue Jun 23, 2023 · 9 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kavimuru
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Press FAB and choose Assign Task

Expected Result:

Description field initially shows as a single line like in other platforms

Actual Result:

Description field initially shows as a multi line

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.31-2
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Expensify/Expensify Issue URL:
Issue reported by: @bernhardoj
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686997207642659

View all open jobs on GitHub

@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

Triggered auto assignment to @greg-schroeder (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@kushu7
Copy link
Contributor

kushu7 commented Jun 23, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Safari (web and mWeb) - Assign Task Description field shows as multiline

What is the root cause of that problem?

Problem is here TextInput with autoGrowHeight.

{(this.props.autoGrow || this.props.autoGrowHeight) && (
// Add +2 to width so that the first digit of amount do not cut off on mWeb - https://github.com/Expensify/App/issues/8158.
<Text
style={[
...this.props.inputStyle,
this.props.autoGrowHeight && styles.autoGrowHeightHiddenInput(this.state.width, maxHeight),
styles.hiddenElementOutsideOfWindow,
styles.visibilityHidden,
]}
onLayout={(e) => this.setState({textInputWidth: e.nativeEvent.layout.width + 2, textInputHeight: e.nativeEvent.layout.height})}
>
{this.state.value || this.props.placeholder}
</Text>
)}

when we have empty string, in safari web and mWeb onLayout doesn't get Called(its getting called in chrome), thus we left with textInputHeight as undefined and its set maxHeight as height here.
this.props.autoGrowHeight && styles.autoGrowHeightInputContainer(this.state.textInputHeight, maxHeight),

What changes do you think we should make in order to solve the problem?

We should define textInputHeight as state variable with default value 0 like we are setting textInputWidth. it will solve our problem globally with all TextInput with autoGrow.

Result
Simulator.Screen.Recording.-.iPhone.14.-.2023-06-24.at.00.56.35.mp4

What alternative solutions did you explore? (Optional)

None

@greg-schroeder
Copy link
Contributor

Asking if this should be fixed separately from #19135

@bernhardoj
Copy link
Contributor

@kavimuru Thanks for creating the issue, but we already have the same report (by applause) here #21280. I have added a comment there to add me as the reporter. Maybe we can either add me to the reporter in that issue or close that in favor of this?

@manjesh-yadav
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

The description field show multiline line in the safari

What is the root cause of that problem?

When we implement auto-grow text input, we use a hidden <Text> component to calculate the component's height to grow <TextInput> because the <TextInput> component doesn't support auto-grow.

We calculate height and width for input when React fired a NativeEvent called onLayout when our hidden <Text> component rendered

  • The problem comes with Safari web browser (also in the Desktop application) when initially component is rendered with no value React is not able to fire NativeEvent
  • And we are not able to calculate the height of the hidden <Text> component
  • Then our <TextInput> component render with max height CSS only

What changes do you think we should make in order to solve the problem?

We just need a value in our hidden <Text> component to fire onLayout event

It will work when we set a placeholder or if we have any state value, if we do not have a placeholder or state then just an Empty string will work, and later it will change with the state value

File: App/src/components/TextInput/BaseTextInput.js

-      {this.state.value || this.props.placeholder}
+    {this.state.value || this.props.placeholder || ' '}

@melvin-bot melvin-bot bot added the Overdue label Jun 26, 2023
@greg-schroeder
Copy link
Contributor

That issue was created first, so I'll close this as a duplicate.

@greg-schroeder
Copy link
Contributor

@bernhardoj i added you as the issue reporter on the other one as you reported it on June 17th

@bernhardoj
Copy link
Contributor

Sweet, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
None yet
Development

No branches or pull requests

5 participants