When editing content that contains an entity reference to nodes using the autocomplete widget, the "Add another item" button extends all the way across the screen.

This is because that button has the input class when it should not.

Comments

ptmkenny created an issue. See original summary.

himanshu_sindhwani’s picture

Assigned: Unassigned » himanshu_sindhwani
matija5’s picture

Assigned: himanshu_sindhwani » Unassigned
Status: Active » Needs review
StatusFileSize
new538 bytes

Hi, this is because 'themes/contrib/drulma/templates/fontawesome5/form/input--submit--addanotheritem.html.twig' extends 'input.html.twig' instead of 'input--submit.html.twig'.

I created a patch with extends 'input--submit.html.twig'.

rodrigoaguilera’s picture

I think I have to test this locally.

@vebrovski Doesn't your change remove the icon from the button?

matija5’s picture

@rodrigoaguilera you are right, it does remove icon from button.

As @ptmkenny said, the problem is in input class of <input> element.

You could wrap <input> element inside 'input.html.twig' with another block and then in 'input--submit--addanotheritem.html.twig' remove that class with <input{{ attributes.removeClass('input') }} />{{ children }}.

Or refactor code for submit template by adding icon to it?

himanshu_sindhwani’s picture

I am not getting any icon on the button and the patch mentioned in #3 solves the problem for me. Can you please let me know if I am missing anything?

Here is what i am having before the patch:
before

and this after the patch:
after

matija5’s picture

There is an element <span class="icon is-left"> missing if patch is applied.

matija5’s picture

StatusFileSize
new1.17 KB

Another take with solution from #5 with keeping {% extends 'input.html.twig' %} in templates/fontawesome5/form/input--submit--addanotheritem.html.twig and removing input class from button.

rodrigoaguilera’s picture

Status: Needs review » Fixed

I finally had the chance to look at it locally in my computer this weekend.

First, the file had the wrong filename so it was picked even when no fontawesome was enabled.

To fix this what I did is just imitate what is done in input--submit--remove--fa5.html.twig with the proper icon.

Thank you for your input.

Status: Fixed » Closed (fixed)

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