ryanoasis / nerd-fonts

Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts: Hack, Source Code Pro, more. Glyph collections: Font Awesome, Material Design Icons, Octicons, & more
https://NerdFonts.com
Other
52.69k stars 3.59k forks source link

cheat-sheet: Add autofocus on load to search input text #1557

Closed guillaumeboehm closed 3 months ago

guillaumeboehm commented 3 months ago

Description

Autofocusing the cheat sheet input text on page load would improve some workflows and I doubt would break other workflows.

I'm not 100% sure I understood the framework, but hopefully this works.

Requirements / Checklist

What does this Pull Request (PR) do?

Adds the autofocus attribute to the search input field.

How should this be manually tested?

See if the search input field is focused automatically on page load

Finii commented 3 months ago

Thanks for the PR.

Usually I hate focus stealing stuff, but here it is ok and helpful I guess. Also considered concerns as stated here: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus

I played around with it a bit and could not find and false trigger or problem.

Great! Thanks again :-)

Finii commented 3 months ago

@allcontributors please add @guillaumeboehm for code

allcontributors[bot] commented 3 months ago

@Finii

I've put up a pull request to add @guillaumeboehm! :tada:

guillaumeboehm commented 3 months ago

Thanks for the PR.

Usually I hate focus stealing stuff, but here it is ok and helpful I guess. Also considered concerns as stated here: developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus

I played around with it a bit and could not find and false trigger or problem.

Great! Thanks again :-)

Oh yeah thanks for the link, good little read. I gotta say I didn't think about accessibility ^^ Anyway thanks for the approval !