jcubic/tagger

Wrap modes put input into second line

jcubic opened this issue · 3 comments

jcubic commented

I'm not sure why this is happening, but wrap mode makes the input that is min-width: 40px go to the second line. It should fit into the first line unless the text doesn't fit.

Przechwycenie obrazu ekranu_2023-05-20_13-46-23

https://codepen.io/jcubic/pen/YbYpqO?editors=1010

@jcubic I think this is more an issue with Firefox not shrinking inputs in a Flexbox. The codepen works correctly in Safari and Chrome. https://bugzilla.mozilla.org/show_bug.cgi?id=1242914

A further look is that Firefox sets the input's size property to a default of 20 which sets the minimum size of the input, overflowing the container and wrapping. Adding size="1" to the input fixes the issues. I'll do some tests on the other browsers then raise a PR

jcubic commented

The screenshot is from Google Chrome but on Linux.

jcubic commented

It seems that adding:

.tagger .tagger-new {
    width: 1px;
}

solves the issue.