P
P
Pavel Emtsov2017-10-12 11:55:13
JavaScript
Pavel Emtsov, 2017-10-12 11:55:13

Native select in safari truncates long text when opened. How to fix it?

59df2d4aedc71423081426.jpeg
Maybe someone faced such a problem? How to undo the fact that long text is cut off? I know that somehow it is possible, but for the second day I can not get to the bottom.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Anatoly Kulikov, 2019-07-09
@anatoly_kulikov

<form action="/">
    <input type="search" name="search">
</form>

S
Stanislav, 2019-07-09
@mzcoding

Can it be like this

<form id="search">
    <input type="search" name="search">
    <button type="submit">OK</button>
</form>

window.onload = function() {
  document.getElementById('search').addEventListener('submit', function(e) {
     e.preventDefault();
     
     let s = this.search.value;
     location.href = "?search=" + s;
  });
};

P
profesor08, 2019-07-10
@profesor08

For form, specify method="GET"for clarity. Or don't specify anything, since GET is the default.

<form method="GET" action="/">
    <input type="search" name="search">
</form>

P
Pavel Emtsov, 2017-10-12
@emtsov

<select>
    <optgroup >
        <option value=""></option>
        <option value="strawberries">Strawberries</option>
    </optgroup>
</select>

The answer was unexpected and simple. You just need to wrap all options in an optgroup . And then the view changes to:
59df36587c043491799879.jpeg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question