Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Mini Cart block: Create native Drawer component #4597

Closed
6 tasks
Aljullu opened this issue Aug 18, 2021 · 3 comments · Fixed by #4608
Closed
6 tasks

Mini Cart block: Create native Drawer component #4597

Aljullu opened this issue Aug 18, 2021 · 3 comments · Fixed by #4608
Assignees
Labels
block: mini-cart Issues related to the Mini-Cart block. focus: FSE Work related to prepare WooCommerce for FSE.

Comments

@Aljullu
Copy link
Contributor

Aljullu commented Aug 18, 2021

In the first iteration of the Mini Cart block, it will open in a drawer that will slide in from the right side of the screen (left side in RTL languages). This issue is about creating a component we can use for this. Ideally, this component should not require React given that we want the drawer to open instantly even if React is not yet executed.

Tasks

  • Functionality:
    • Open the drawer when clicking the Mini Cart button.
    • Make it possible to close the drawer when clicking on the close button.
    • Make it possible to close the drawer when clicking outside of it.
  • Styling:
    • Slide in the drawer from the right (from the left in RTL languages).
  • Accessibility:
    • Capture focus inside the drawer and move it back to the content when closed.
    • Alert screen readers when the drawer is opened/closed.
@Aljullu Aljullu self-assigned this Aug 18, 2021
@Aljullu Aljullu added the block: mini-cart Issues related to the Mini-Cart block. label Aug 18, 2021
@Aljullu Aljullu changed the title Create native Drawer component Mini Cart block: Create native Drawer component Aug 18, 2021
@Aljullu Aljullu added the focus: FSE Work related to prepare WooCommerce for FSE. label Aug 18, 2021
@senadir
Copy link
Member

senadir commented Aug 18, 2021

Is the plan to lazy load, mount and render React once the drawer is open?

@Aljullu
Copy link
Contributor Author

Aljullu commented Aug 18, 2021

Is the plan to lazy load, mount and render React once the drawer is open?

More or less, the idea is to start loading React and rendering the components as soon as the shopper hovers the Mini Cart button (see #4600), but there is the chance that they will click on it before React has finished loading, that's why ideally the drawer component should not rely on React.

@Aljullu
Copy link
Contributor Author

Aljullu commented Aug 20, 2021

Heads-up that in #4608 I applied a middle-ground solution. There is a native HTML element to render the drawer skeleton instantly, but then it's replaced with a Gutenberg Modal on the fly so we get all accessibility perks from it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: mini-cart Issues related to the Mini-Cart block. focus: FSE Work related to prepare WooCommerce for FSE.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants