Skip to content

Web - Pointer cursor displayed on next button even if next month is not available to select #21789

Closed

Description

@kbecciv

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. Open the app
  2. Open settings
  3. Open profile
  4. Open personal details
  5. Open date of birth
  6. Navigate to 2018
  7. If current month is not displayed, navigate to current month
  8. Select any date and click on save
  9. Go back and revisit, hover on month next button to observe that it displays 'not-allowed' cursor as next month is not available till now
  10. Navigate few month back and again navigate to current month and hover on next button for months to observe that now it displays pointer cursor even though next month is not available

Expected Result:

App should display 'not-allowed' cursor on next button if next month is still not available to select

Actual Result:

App displays pointers cursor on next button if we navigate back in months and again comeback to current month

Workaround:

Unknown

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.32-5
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

Recording.928.mp4
pointer.cursor.on.not.available.month.1.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1687714781494409

View all open jobs on GitHub

Activity

  1. added
    Daily
    Bug
    on Jun 28, 2023
  2. melvin-bot commented on Jun 28, 2023

    @melvin-bot

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

  3. melvin-bot commented on Jun 28, 2023

    @melvin-bot

    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
  4. Shivam7-1 commented on Jun 28, 2023

    @Shivam7-1

    Proposal

    Pointer cursor displayed on next button even if next month is not available to select

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

    What is the root cause of that problem?

    The error in the code is that the next button in the datepicker always displays the pointer cursor, even if the next month is not available to select. The expected behavior is to display the 'not-allowed' cursor when the next month is not available.
    This Error occurred by Index.js File in New date picker Folder.
    Inside the render() method of the CalendarPicker component Causes This errro

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

    In Solution of this issue The code can modify as follows:

    To fix this issue, we need to modify the CalendarPicker component in Index.js. Inside the render() method of the CalendarPicker component, locate the nextMonthButton element and add a condition to check if the next month is available. If the next month is not available, set the cursor style to 'not-allowed'; otherwise, set it to 'pointer'.

    In modified code, we will added the isNextMonthAvailable variable to determine if the next month is available.
    We use this variable to conditionally set the style and disable the button if the next month is not available. Additionally, we set the cursor style to not-allowed (calendarNextMonthButtonDisabled style) when the next month is not available.

  5. samh-nl commented on Jun 28, 2023

    @samh-nl
    Contributor

    Proposal

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

    The next month button cursor does not reflect the button being disabled.

    What is the root cause of that problem?

    The props.disabled references an outdated copy of the component state.
    Since props.disabled is false prior to pressing the button (and only changes to true afterwards), it will set it back to false upon reaching this code, thereby overriding the correct value.

    InteractionManager.runAfterInteractions(() => {
    if (!(onPress instanceof Promise)) {
    setDisabled(props.disabled);
    return;
    }
    onPress.finally(() => {
    setDisabled(props.disabled);
    });
    });

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

    Introducing an intermediary variable which incorporates the disabled state and the state of whether runAfterInteractions has completed.

  6. melvin-bot commented on Jun 28, 2023

    @melvin-bot

    📣 @samh-nl! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  7. samh-nl commented on Jun 28, 2023

    @samh-nl
    Contributor

    Contributor details
    Your Expensify account email: h.sam.lw@gmail.com
    Upwork Profile Link: https://upwork.com/freelancers/~016c982fe69f86aff8

  8. melvin-bot commented on Jun 28, 2023

    @melvin-bot

    ⚠️ Missing/invalid email or upwork profile link. Please make sure you add both your Expensify email and Upwork profile link in the format specified.

  9. samh-nl commented on Jun 28, 2023

    @samh-nl
    Contributor

    Contributor details
    Your Expensify account email: h.sam.lw@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/~016c982fe69f86aff8

  10. melvin-bot commented on Jun 28, 2023

    @melvin-bot

    ⚠️ Missing/invalid email or upwork profile link. Please make sure you add both your Expensify email and Upwork profile link in the format specified.

  11. manjesh-yadav commented on Jun 28, 2023

    @manjesh-yadav
    Contributor

    This is regression 1b215f6

    Proposal

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

    The pointer cursor is displayed on the next button even if next month is not available to select

    What is the root cause of that problem?

    This is working fine before this PR.

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

    When we already remove 'onPressIn', 'onPressOut' props in this PR we do not need to handle disable state internally.

    just change in src/components/Pressable/PressableWithFeedback.js

    - disabled={disabled}
    - disabled={props.disabled}
  12. mallenexpensify commented on Jun 30, 2023

    @mallenexpensify
    Contributor

    @dhanashree-sawant I think the bug you're reporting is that there can be a small amount of time before the 🚫 shows, cuz I see it at second 24 of your vid
    image

    And when I tried to reproduce, I had the same results, it sometimes took a tiny bit of time before it showed the 🚫

    Is anyone able to reproduce and show a vid where he 🚫 doesn't show for a few seconds or longer? If so, can you drop in a vid?

  13. dhanashree-sawant commented on Jun 30, 2023

    @dhanashree-sawant

    Hi @mallenexpensify, yes agree, in older version, it didn't changed the cursor at all but now yes, after few seconds it changes to 'not-alllowed' cursor.

  14. melvin-bot commented on Jul 3, 2023

    @melvin-bot

    @mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  15. melvin-bot commented on Jul 5, 2023

    @melvin-bot

    @mallenexpensify Eep! 4 days overdue now. Issues have feelings too...

  16. mallenexpensify commented on Jul 5, 2023

    @mallenexpensify
    Contributor

    K, thanks @dhanashree-sawant , if anyone has examples where the 🚫 doesn't show quickly, please drop in comment and I'll reopen.

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

Metadata

Metadata

Labels

BugDaily

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions