ASU / asu-unity-stack

ASU Unity Design System
https://unity.web.asu.edu/
Other
13 stars 8 forks source link

fix(app-webdir-ui): focus cursor in search box on page load #1175

Closed davidornelas11 closed 1 year ago

davidornelas11 commented 1 year ago

Description

Focus cursor in search bar on page load

Links

Checklist

Browsers

Images

mlsamuelson commented 1 year ago

The #1177 PR issue turns out to be unrelated to this PR. Just for the record.

scott-williams-az commented 1 year ago

Do we need a way enable/disable focus onLoad? Have we identified the expected behavoir when there are 2 elements trying to focus on page load? See Tabbed Panel https://github.com/ASU/asu-unity-stack/blob/dev/packages/components-core/src/components/TabbedPanels/components/TabHeader.js#L22

mlsamuelson commented 1 year ago

@scott-williams-az Good point. I didn't realize that the tabbed panels were also capturing focus. And in the case of the Search Page component, it's using tabbed panels and the search focus...

scott-williams-az commented 1 year ago

Now that I think about it, I may have changed the tabbed panels from focus to scroll into view (the code to focus on the tab might actually be unused, if it is we can remove it)

scott-williams-az commented 1 year ago

Sorry for the back and forth, we are setting focus on the tabbed panels https://github.com/ASU/asu-unity-stack/blob/dev/packages/components-core/src/components/TabbedPanels/index.js#L62

mlsamuelson commented 1 year ago

I think that ought to work, and tests out locally.