codidact / qpixel

Q&A-based community knowledge-sharing software
https://codidact.com
GNU Affero General Public License v3.0
397 stars 68 forks source link

automatically focus in the textbox when you start a search #1426

Closed cellio closed 1 month ago

cellio commented 1 month ago

Fixes https://github.com/codidact/qpixel/issues/829 by implementing Taeir's suggestion. (Art approved the approach in the comments there.)

trichoplax commented 1 month ago

Straight after recommending making this change in Co-Design instead, I've just seen Art's comment on the issue this pull request fixes:

Probably better to do this in QPixel. Makes more sense for an application-specific use case than doing it as part of the design framework.

This is a good point, and making a special case in the design framework is a little messy. Maybe it's better to keep this in QPixel for now, and avoid changing Co-Design until #1432 is worked on (which is unlikely to be soon as it seems low priority). At that point there would be no special case in Co-Design, as the browser would handle the autofocus automatically with no JS required.