Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a submit button for Search field #95

Closed
cara-tm opened this issue Dec 31, 2021 · 2 comments
Closed

Add a submit button for Search field #95

cara-tm opened this issue Dec 31, 2021 · 2 comments
Labels

Comments

@cara-tm
Copy link

cara-tm commented Dec 31, 2021

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.

@lucaslarroche
Copy link
Member

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).

@cara-tm
Copy link
Author

cara-tm commented Jan 4, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@cara-tm @lucaslarroche and others