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

v2 loading on search group not working #411

Open
longrunningprocess opened this issue Oct 2, 2023 · 6 comments
Open

v2 loading on search group not working #411

longrunningprocess opened this issue Oct 2, 2023 · 6 comments
Labels

Comments

@longrunningprocess
Copy link

Please search for duplicate or closed issues first.

Describe the issue

It looks there might be a missing selector for the loading icon (https://github.com/picocss/pico/blob/v2/css/pico.css#L2347) which does not take into account input[type=submit]

Current Behavior

Supplying the following html does not produce a loading indicator:

<form role="search">
   <input type="search" name="query" placeholder="Search" />
   <input type="submit" value="Search" aria-busy="true" />
</form>

Expected Behavior

The loading indicator should appear on the input[type=submit] as it does for buttons.

Reproduction URL

Simply adding the aria-busy="true" to the docs will reveal the bug.

Environment

macOS, Chrome

@lucaslarroche
Copy link
Member

@longrunningprocess, I experimented more and I don't understand why it doesn't work. Probably due to the nature of the input[type=submit] element.
Let me know if you have any ideas.

@longrunningprocess
Copy link
Author

Not off the top of my head but if I figure it out I'll definitely let you know

@jasperkelder
Copy link

I just bumped into this bug too and did some digging. Apparently input[type=submit] is a 'replaced' element which cannot hold content. The ::before and ::after pseudo-elements are used to add content before or after an element's content. The only workaround to me seems to be applying a spinner background directly to the input element itself.

@lucaslarroche
Copy link
Member

I don't have a clean workaround.
Also <button type="submit">Submit</button> is working.

I might close this issue.

@longrunningprocess
Copy link
Author

No worries, maybe you could add a reference in the docs to this conversation?

@jonasgeiler
Copy link

jonasgeiler commented Aug 21, 2024

Isn't this happening because inputs are literally ignored due to the :not(input, ...) selector here:

#{$parent-selector} [aria-busy="true"]:not(input, select, textarea, html) {

I have the same problem. Setting aria-busy="true" on the submit button in my form doesn't show the loading indicator. Although, the pointer-events: none style is being used, which is also defined in the _loading.scss file above. I don't think that's right.

Edit: I fixed it by just using a <button type="submit"> which is the recommended way anyway for modern HTML forms, since buttons can include more than just plain text.

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

4 participants