Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserter: Render menu as content of Popover #2364

Merged
merged 1 commit into from
Aug 11, 2017

Conversation

aduth
Copy link
Member

@aduth aduth commented Aug 11, 2017

This pull request seeks to resolve an issue where clicking the Inserter button in content causes the menu to appear overlapping the button, rather than above it. The issue is described at #2323 (comment):

Seems the div wrapper introduced in #2321 is causing some issues with Popover being able to calculate its offset position. I think eventually we'll want to move withFocusReturn to be part of Popover itself, which should hopefully provide a better long-term solution.

This pull request merely extracts most of the 26b75c8 commit that was already slated for #2323 while other requested changes are in-progress there.

Before After
Before image

Testing instructions:

This is most obvious for inserter menu which opens upwards, meaning it must be for a post which has enough content to allow vertical upward space to open. Try the Demo content or a new post with at least a couple blocks added.

Verify that the content inserter menu opens upward above button:

  1. Navigate to Gutenberg > Demo
  2. Scroll to bottom of content
  3. Toggle Inserter
  4. Note insert shows above button

@aduth aduth added [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Type] Bug An existing feature does not function as intended labels Aug 11, 2017
@aduth aduth force-pushed the update/inserter-menu-position branch from 486dae9 to 0af076d Compare August 11, 2017 13:22
@codecov
Copy link

codecov bot commented Aug 11, 2017

Codecov Report

Merging #2364 into master will decrease coverage by 0.02%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2364      +/-   ##
==========================================
- Coverage   25.69%   25.66%   -0.03%     
==========================================
  Files         154      155       +1     
  Lines        4811     4840      +29     
  Branches      810      814       +4     
==========================================
+ Hits         1236     1242       +6     
- Misses       3020     3040      +20     
- Partials      555      558       +3
Impacted Files Coverage Δ
editor/inserter/index.js 0% <0%> (ø) ⬆️
editor/inserter/menu.js 48.41% <100%> (ø) ⬆️
editor/index.js 0% <0%> (ø) ⬆️
editor/modes/visual-editor/block.js 0% <0%> (ø) ⬆️
components/popover/provider.js 100% <0%> (ø)
components/popover/index.js 95% <0%> (+0.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 726769d...0af076d. Read the comment docs.

@aduth aduth merged commit f0062fe into master Aug 11, 2017
@aduth aduth deleted the update/inserter-menu-position branch August 11, 2017 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant