bangank36 / spriral-learning

My learning resource
MIT License
1 stars 0 forks source link

Gutenberg: issue #53674 Writing Flow: Shift + down-arrow #22

Closed bangank36 closed 1 year ago

bangank36 commented 1 year ago

Get started with development

*. Wordpress development enviroment

  1. Using local for WP instance
  2. Open the instance folder
  3. Clone Gutenberg repo: git clone https://github.com/WordPress/gutenberg.git
  4. npm install
  5. npm run dev

Summary

Insights

Image

Reference

bangank36 commented 1 year ago

23 Aug 2023

I still have to understand the mechanism behind the multi-selection

Selecting across blocks is possible by temporarily setting the contentEditable attribute to true

  • Shift+Arrow make the container contenteditable, reference
  • Since the selection is updated by browser, useSelectionObserver is called
  • multiSelect is dispatched
  • onSelectionChange logic
  • When a richtext is selected selectionChange action is fired SELECTION_CHANGE
  • In turn reducer selection will update the store
  • 'SELECTION_CHANGE' - 'RESET_SELECTION' - 'MULTI_SELECT' - 'RESET_BLOCKS'
  • So we need to investigate the mechanism of the 'MULTI_SELECT' action? Answer: it is explain above, the browser select the blocks and Gutenberg will read the selection based on selectionchange event

Recordings

Image

None Spacer Block Tiptap
Image Image
bangank36 commented 1 year ago

23 Aug 2023

bangank36 commented 1 year ago

26 Aug 2023

bangank36 commented 1 year ago

28 Aug 2023

Status of e2e testings

  1. Add new e2e testing for Shift+Arrow on editor/various/multi-block-selection.spec.js
  2. Re-rerun e2e testing for Spacer block on editor/blocks/spacer.spec.js
  3. Current e2e for copy paste on editor failed
bangank36 commented 1 year ago

Staled

bangank36 commented 1 year ago

Staled