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

Cart Block: Order summary inner blocks controls appear on the left side of the screen #6698

Closed
ralucaStan opened this issue Jul 18, 2022 · 2 comments · Fixed by #6973
Closed
Assignees
Labels
block: cart Issues related to the cart block. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue/PR concerns a confirmed bug.

Comments

@ralucaStan
Copy link
Contributor

Describe the bug

Cart Block: Order summary inner blocks controls appear on the left side of the screen

To reproduce

Steps to reproduce the behaviour:

  1. Go to the Cart Block
  2. Click on the fee inner block
  3. Notice that the controls appear on the left side

Expected behaviour

The controls should appear aligned with the left margin of the Order summary block. Like in the Checkout block.

Screenshots

Screenshot 2022-07-18 at 17 45 35

@ralucaStan ralucaStan added type: bug The issue/PR concerns a confirmed bug. block: cart Issues related to the cart block. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. labels Jul 18, 2022
@tarunvijwani tarunvijwani self-assigned this Jul 29, 2022
@tarhi-saad
Copy link
Contributor

tarhi-saad commented Aug 22, 2022

Hi @tarunvijwani! I've done some debugging and found a potential solution, but there are still some questions to be answered:

Current behavior

The current behavior isn't a bug but an option: the toolbars of all child Blocks (applied deeply, recursive) can have their toolbars "captured" and shown on the Block which is consuming InnerBlocks.

And the option responsible for this change of behavior is __experimentalCaptureToolbars.

Potential fixe

I added the option __experimentalCaptureToolbars and set it to false as a prop of the InnerBlocks component in the assets/js/blocks/cart/edit.js file:

<CartProvider>
	<InnerBlocks
		allowedBlocks={ ALLOWED_BLOCKS }
		template={ defaultTemplate }
		templateLock={ false }
		__experimentalCaptureToolbars={ false } // This is the line in question!
	/>
</CartProvider>

image

Remaining questions

The default value of __experimentalCaptureToolbars is supposed to be false, so I was wondering how come this option has a value of true:

image

I console logged this value from this file.

After applying the above fixe, the templateLock value changes as well for some reason:

image

@tarunvijwani
Copy link
Contributor

This is very useful. Thank you so much @tarhi-saad. 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: cart Issues related to the cart block. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants