pico icon indicating copy to clipboard operation
pico copied to clipboard

Add a submit button for Search field

Open cara-tm opened this issue 3 years ago • 2 comments

Maybe the Search field need a Submit button:

<!-- Search -->
<label for="search">Search
	<input type="search" id="search" name="search" placeholder="Search">
	<input aria-label="Find" type="submit" name="search_submit" value=""> 
</label>

And the corresponding rules:

input[type="search"] + input[type="submit"]{
    position: absolute;
    z-index: 1;
    left: 0;
    width: fit-content;
    background: transparent;
    border: none
   }

html input[type="search"]~input[type="submit"]:focus{box-shadow:none}

Note: rules updated.

cara-tm avatar Dec 31 '21 05:12 cara-tm

I like this idea too. It should probably be a separate SCSS file to be disabled.

It can be more generic (not only for search, but for all inputs text):

input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) + input[type="submit"],
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) + input[type="button"],
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) + button,
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) + a[role="button] {
   ...
}

Another crazy long CSS selector 😬...

We might want a visible button like here. Not so easy without a class on the label if we want to properly manage all the states (hover, focus, invalid).

lucaslarroche avatar Jan 01 '22 06:01 lucaslarroche

I'm trying to obtain such a Bootstrap model (above linked). The only solution is Flexbox.

cara-tm avatar Jan 04 '22 04:01 cara-tm