React-dates: Data-visible false duplication

Created on 1 Aug 2019  路  5Comments  路  Source: airbnb/react-dates

react-dates version
e.g. [email protected]

Describe the bug
Non-urgent. I apologize if this is a dumb question.

In Jest snapshots, I am seeing three instances of the same month (eg. "September 2019"). Two of these three are data-visible: false, the other is data-visible: true. When inspecting the live version in browser, I don't see any trace of these data-visible: false months.

Is there a reason for this duplication? Is this something that is likely caused by the implementation? Thank you in advance for you help.

Screenshots/Gifs
Screen Shot 2019-08-01 at 1 35 48 PM

question

All 5 comments

Can anyone help with this please?

That depends on your snapshot tool; I don't endorse or recommend snapshot tests (they're brittle), but you could use enzyme's .debug() to see what's there?

True about the snapshot tests, but my particular concern is why DatePickerRangeController seems to render elements with [data-visible="false"] at all. I presume it's for spacing/navigation?

It's done here - i believe because we render 3 months at a time, so we can smoothly move forward and back, but only the middle one is visible.

Thanks so much!! Just wanted to confirm. Sorry to bug ya.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ekohanyi picture ekohanyi  路  3Comments

krissalvador27 picture krissalvador27  路  3Comments

Daniel15 picture Daniel15  路  3Comments

mrseanbaines picture mrseanbaines  路  3Comments

Jesus-Gonzalez picture Jesus-Gonzalez  路  3Comments