Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Datepicker: resize dropdown on tab switch #294

Merged
merged 3 commits into from
Sep 19, 2018
Merged

Conversation

psealock
Copy link
Collaborator

@psealock psealock commented Aug 13, 2018

Refresh the dropdown size when switching tabs so scrollable areas are can be accessed.

Test

  1. Checkout master branch of Gutenberg
  2. /wp-admin/admin.php?page=wc-admin#/analytics/products
  3. Open the datepicker
  4. Shrink the viewport to just the height of the datepicker
  5. Switch to Custom tab, which is longer than the Presets tab
  6. Scroll the viewable area and ensure all of it can be seen/accessed

Depends on WordPress/gutenberg#8906 (merged)
Fixes #252

@psealock psealock added the status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. label Aug 13, 2018
@timmyc timmyc added this to Needs Review 👀 in Isotope Aug 20, 2018
@timmyc timmyc moved this from Needs Review 👀 to ✌️Sprint 4 Backlog in Isotope Sep 13, 2018
@timmyc timmyc moved this from ✌️Sprint 4 Backlog to Project Backlog 🔙 in Isotope Sep 13, 2018
@psealock psealock added status: in progress and removed status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. labels Sep 18, 2018
@timmyc
Copy link
Contributor

timmyc commented Sep 18, 2018

should we wait till 3.9 drops to merge this?

@psealock
Copy link
Collaborator Author

No need to wait, there is a check to see if refresh exists. I checked with 3.8 and as expected, nothing happens.

@psealock psealock moved this from Project Backlog 🔙 to ✌️Sprint 4 Backlog in Isotope Sep 19, 2018
@psealock psealock moved this from ✌️Sprint 4 Backlog to Needs Review 👀 in Isotope Sep 19, 2018
Copy link
Contributor

@timmyc timmyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the backwards compat explanation. This is testing out well for me.

refreshDropdown() {
setTimeout( () => {
const dropdown = this.dropdownRef.current;
dropdown.refresh && dropdown.refresh();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah gotcha - makes sense now :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants