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

Fix navigation block link control zero value in it #36198

Merged

Conversation

amustaque97
Copy link
Member

@amustaque97 amustaque97 commented Nov 4, 2021

Fixes: #36170

Description

In this commit, I have written condition properly. Zero was coming
because of conditional rendering where we should not put number on
the left side of && (logical and) operator.

How has this been tested?

  1. Add a nav block
  2. Start empty
  3. Add a link
  4. Select a URL to a page or post
  5. Once done, click the link icon on the toolbar
  6. Click the 'unlink' button in the link popover
  7. Click on the 'Add link' text
  8. Observe the link popover shows with a 0 in the top left corner

Screenshots

Screenshot 2021-11-04 at 11 52 16 AM

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

cc @Mamaduka

In this commit, I have written condition properly. Zero was coming
because of conditional rendering where we should not put number on
the left side of && (logical and) operator.
@amustaque97 amustaque97 requested a review from ellatrix as a code owner November 4, 2021 06:48
@talldan talldan added [Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended labels Nov 5, 2021
Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

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

Thanks @amustaque97 ! 💯

@ntsekouras ntsekouras merged commit 098278b into WordPress:trunk Nov 5, 2021
@github-actions github-actions bot added this to the Gutenberg 11.9 milestone Nov 5, 2021
@getdave getdave added [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) and removed [Block] Navigation Affects the Navigation Block labels Nov 5, 2021
@amustaque97 amustaque97 deleted the fix/nav-block-link-has-zero branch January 21, 2022 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation block link popover has a 0 in it after unlinking and relinking
4 participants