You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Web - Pointer cursor displayed on next button even if next month is not available to select #21789
If current month is not displayed, navigate to current month
Select any date and click on save
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
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
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.
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.
📣 @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:
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.
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.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
@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
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?
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.
Activity
melvin-bot commentedon Jun 28, 2023
Triggered auto assignment to @mallenexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 28, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)Shivam7-1 commentedon Jun 28, 2023
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.jsFile in New date picker Folder.Inside the
render()method of theCalendarPickercomponent Causes This errroWhat 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
CalendarPickercomponent inIndex.js. Inside therender()method of theCalendarPickercomponent, locate thenextMonthButtonelement 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
isNextMonthAvailablevariable 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 (
calendarNextMonthButtonDisabledstyle) when the next month is not available.samh-nl commentedon Jun 28, 2023
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.
App/src/components/Pressable/PressableWithFeedback.js
Lines 80 to 88 in 70bf90d
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.
melvin-bot commentedon Jun 28, 2023
📣 @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:
Format:
samh-nl commentedon Jun 28, 2023
Contributor details
Your Expensify account email: h.sam.lw@gmail.com
Upwork Profile Link: https://upwork.com/freelancers/~016c982fe69f86aff8
melvin-bot commentedon Jun 28, 2023
samh-nl commentedon Jun 28, 2023
Contributor details
Your Expensify account email: h.sam.lw@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~016c982fe69f86aff8
melvin-bot commentedon Jun 28, 2023
manjesh-yadav commentedon Jun 28, 2023
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.jsmallenexpensify commentedon Jun 30, 2023
@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

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?
dhanashree-sawant commentedon Jun 30, 2023
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.
melvin-bot commentedon Jul 3, 2023
@mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Jul 5, 2023
@mallenexpensify Eep! 4 days overdue now. Issues have feelings too...
mallenexpensify commentedon Jul 5, 2023
K, thanks @dhanashree-sawant , if anyone has examples where the 🚫 doesn't show quickly, please drop in comment and I'll reopen.