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

When using extraDayText, can't select date by clicking on extra text (bug?) #174

Closed
solidaverage opened this issue Oct 3, 2023 · 5 comments

Comments

@solidaverage
Copy link

When using the extraDayText feature, the extra text inserted into the day cell can't be clicked on to select that day at the arrival/departure day. Everywhere else in the cell is clickable, but not the area with the extra text.

I'm not sure if this counts a bug or not? I think so, because users would, I think, naturally expect to be able to click anywhere in the cell to pick that date. But please let me know if you think it's worth addressing.

Thank you

@benitolopez
Copy link
Owner

benitolopez commented Oct 3, 2023

Yes, you're right.

You can use this CSS to fix the issue:

.datepicker__month-day--with-extra span {
    pointer-events: none;
}

This assumes that you are appending a span element.

I'll add the same fix in the demo. But this CSS can't be included in the library because I cannot know what element is being appended. Everyone can append the element they want.

@solidaverage
Copy link
Author

Great. Thank you.

@solidaverage
Copy link
Author

solidaverage commented Oct 5, 2023

Oops, I spoke to soon. I just tested it and the CSS fix works for the first time you select arrival/departure, but then it stops working (can't click on extra text anymore).

Inspecting the page, it looks like after the first range select, the class "datepicker__month-day--with-extra" is being removed from the day <td>. (or probably all the classes on the are replaced after departure date is selected, but the extra text one isn't being added back)

I just tested on the demo site and that removal of that class after first range select is there too.

I think I can work around this with different CSS, but I think the code needs to be updated to ensure that the extra text class is always there.

@benitolopez
Copy link
Owner

Correct. Fixed in 4.6.2.

@solidaverage
Copy link
Author

Thanks

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

No branches or pull requests

2 participants