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

[VISUAL ISSUE] Global create menu buttons don’t fill container on iPad #6453

Closed
jasperhuangg opened this issue Nov 23, 2021 · 11 comments
Closed
Assignees
Labels
AutoAssignerTriage Auto assign issues for triage to an available triage team member External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement. Weekly KSv2

Comments

@jasperhuangg
Copy link
Contributor

jasperhuangg commented Nov 23, 2021

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


Upload.from.GitHub.for.iOS.MOV

Action Performed:

  1. Open App on iPad.
  2. Open the global create menu (green circle +).
  3. Hold your finger on any button, notice how the hover styles don't apply to the entire length of the container.

Expected Result:

The button should flex grow to fill the entire container.

Actual Result:

The buttons have the same width they'd have on an iPhone.

Workaround:

N/A

Platform:

Where is this issue occurring?

  • iOS

Version Number:
Reproducible in staging?:
Reproducible in production?:
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:

View all open jobs on GitHub

@jasperhuangg jasperhuangg added AutoAssignerTriage Auto assign issues for triage to an available triage team member Daily KSv2 labels Nov 23, 2021
@MelvinBot
Copy link

Triggered auto assignment to @tjferriss (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@MelvinBot MelvinBot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Nov 23, 2021
@jasperhuangg jasperhuangg changed the title [ VISUAL ISSUE] Global create menu buttons don’t fill container on iPad [VISUAL ISSUE] Global create menu buttons don’t fill container on iPad Nov 23, 2021
@jasperhuangg jasperhuangg added AutoAssignerTriage Auto assign issues for triage to an available triage team member External Added to denote the issue can be worked on by a contributor labels Nov 23, 2021
@MelvinBot
Copy link

Current assignee @tjferriss is eligible for the AutoAssignerTriage assigner, not assigning anyone new.

@MelvinBot
Copy link

Triggered auto assignment to @puneetlath (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@jasperhuangg
Copy link
Contributor Author

jasperhuangg commented Nov 23, 2021

Adding external label as I am an engineer and can confirm that it can be fixed this way.

cc @puneetlath

@jasperhuangg jasperhuangg added Improvement Item broken or needs improvement. Weekly KSv2 and removed Daily KSv2 labels Nov 23, 2021
@jasperhuangg
Copy link
Contributor Author

jasperhuangg commented Nov 23, 2021

Assigning Weekly as this is a visual issue, and is also really easy to fix.

@PrashantMangukiya
Copy link
Contributor

Proposed Solution:

Here is the problem:
Within BasePopoverMenu.js at line 40 it set styles.createMenuContainer for large screen as under:

<View style={this.props.isSmallScreenWidth ? {} : styles.createMenuContainer}>

So createMenuContainer always set width: variables.sideBarWidth - 40, i.e. it will not show full width in large screen.

App/src/styles/styles.js

Lines 826 to 829 in 36558e0

createMenuContainer: {
width: variables.sideBarWidth - 40,
paddingVertical: 12,
},

Solution:
From index.native.js we need to pass containerStyles props (Not exist, we need to create) to BasePopoverMenu.js component, so it will make it full width as shown implementation below:

Add containerStyles props to src/components/PopoverMenu/BasePopoverMenu.js

const propTypes = {
     ...,
    // eslint-disable-next-line react/forbid-prop-types
    containerStyles: PropTypes.object,               // *** Add this code
    ...,
};

const defaultProps = {
    ...,
    containerStyles: {},                  // *** Add this code
};

// *** Update style as shown below 
<View style={this.props.isSmallScreenWidth ? {} : [styles.createMenuContainer, this.props.containerStyles]}>  
  ....
</View>

Add below code to src/components/PopoverMenu/index.native.js

return (
  <BasePopoverMenu
      // eslint-disable-next-line react/jsx-props-no-spreading
      {...this.props}
      onMenuHide={this.onMenuHide}
      onItemSelected={item => this.selectItem(item)}
      containerStyles={styles.w100}                    // *** Add this code
  />
);

Update below code to src/components/AttachmentPicker/index.native.js:

// *** Update style as shown below 
<View style={this.props.isSmallScreenWidth ? {} : [styles.createMenuContainer, styles.w100]}>
  ....
</View>

So this will solve problem everywhere for native iPad etc. For native small screen it behave as it is.

Below is screen record: It works as expected after this updates.

6453-iPad.mp4

@Santhosh-Sellavel
Copy link
Collaborator

@puneetlath @jasperhuangg

Fix will be no longer needed for this issue, global create menu width should not be of the full-screen width issue raised here #5754

The issue is fixed in the PR #6278 it's merged!

This Issue no longer exists now. Video for reference

iPad.mov

So let's close this.

@puneetlath
Copy link
Contributor

Makes sense thanks @Santhosh-Sellavel.

And thanks for taking the time to make a proposal @PrashantMangukiya!

@Santhosh-Sellavel
Copy link
Collaborator

I see the PR #6278 Changes is reverted in PR #6523, because it caused a few deploy blockers, so we may need to reconsider this!

cc: @puneetlath @jasperhuangg

@parasharrajat
Copy link
Member

#6278 would be reworked. It was reverted for regression. The author will fix the regression and resubmit.

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Dec 1, 2021

#6278 would be reworked. It was reverted for regression. The author will fix the regression and resubmit.

Then we are good here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoAssignerTriage Auto assign issues for triage to an available triage team member External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement. Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants