Skip to content

Navigation Menu Item: fix showing input placeholder - #18374

Merged
retrofox merged 1 commit into
masterfrom
update/navigation-menu-item-input-placeholder
Nov 7, 2019
Merged

retrofox merged 1 commit into
masterfrom
update/navigation-menu-item-input-placeholder

Conversation

@retrofox

@retrofox retrofox commented Nov 7, 2019

Copy link
Copy Markdown
Contributor

Description

It fixes the visual issue which happens when the input is selected but not focused not showing the Add Item... placeholder.

Fixes #18368

How has this been tested?

  1. Apply these changes
  2. Create / Edit a new item. Just be sure the item content is empty.
  3. If the input is focused confirm you see the caret and be able to type
  4. If not focused, you should see the Add item... placeholder. For this, open the LinkControl popover, for instance.

Screenshots

item-text-placeholder

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.

it fixes the visual issue which happens when the input is selected but not focused, showing the `Add Item...` placeholder.
min-width: 20px;
}

.block-editor-rich-text__editable.is-selected:not(.keep-placeholder-on-focus):not(:focus) [data-rich-text-placeholder]::after {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That is quite the selector!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

proud to got it!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is this doing? I don't see any difference when I remove this rule. It sounds like something should be fixed for rich text instead of in the block.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That seems to be correct, @ellatrix. The component has been developing constantly lately, and I think it's why these changes don't impact its behavior currently.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've removed it in #19822.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. 🙏

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually, @ellatrix, it seems that we've introduced a regression.

no-cartet-issue

When the user tries to set the link text, it doesn't show the caret.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Strange, I see it:

Screenshot 2020-01-23 at 17 44 41

Is it caused by this PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. :-D

Fixed here: #20075

@retrofox
retrofox merged commit f4cbd5f into master Nov 7, 2019
@retrofox
retrofox deleted the update/navigation-menu-item-input-placeholder branch November 7, 2019 22:45
@youknowriad youknowriad added this to the Gutenberg 6.9 milestone Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Navigation Affects the Navigation Block

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NavigationMenuItem: Set placeholder when creating a new item.

4 participants