Olivero: Button can't contain div element in it. In the file drupal/core/themes/olivero/templates/block/block--secondary-menu--plugin-id--search-form-block.html.twig div have a parent element button, which is not allowed.

The issue is that a button can contain only Inline Elements, and div is a Block Element.

Proposer resolution: alternative is to use span

    <button class="block-search-wide__button" aria-label="{{ 'Toggle Search Form'|t }}" data-drupal-selector="block-search-wide-button">
      {% include "@olivero/../images/search.svg" %}
      <div class="block-search-wide__button-close"></div>
    </button>
CommentFileSizeAuthor
#3 html5validator.png49.87 KBindrajithkb
#2 3226865-2.patch964 bytesgauravvvv

Comments

Gauravmahlawat created an issue. See original summary.

gauravvvv’s picture

Status: Active » Needs review
StatusFileSize
new964 bytes

I have attached a patch with proposed solution. Please review.

indrajithkb’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new49.87 KB

Hi @Gauravmahlawat nice catch and thanks for the patch, I have checked with the html5 validator (through online), yes you are right we need to change the block element (div) to inline element (span).
html5 validation result for ref.

image

And applied the #2 patch successfully, so changing the status to RTBC

mherchel’s picture

+1 RTBC. Good catch!

I tested this under FF, Safari, and Chrome. I also double checked that this was the only place we're hard coding a block element within a button.

  • lauriii committed 5ac0edd on 9.3.x
    Issue #3226865 by Gauravmahlawat, Indrajith KB, mherchel: Olivero:...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed 5ac0edd and pushed to 9.3.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.