aidenybai / million

Optimize React performance and make your React 70% faster in minutes, not months.
https://million.dev
MIT License
16.09k stars 561 forks source link

<input> blurring as soon as it gains focus #886

Closed Brendonovich closed 5 months ago

Brendonovich commented 6 months ago

What version of million are you using?

2.6.4

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

Mac

What browser are you using?

Brave

Describe the Bug

When Spacedrive's SearchBar component is wrapped in block, focusing it using either a click or keyboard navigation causes the input to immediately be un-focused, firing the onBlur handler. This could have something to do with our onFocus handler setting state further up the tree. I haven't made a minimal repro, but this is very reproducible within spacedrive. Head to a page like Recents and focus the search bar. A colleague has managed to fix this by adding // million-ignore to our TopBar component, but the fact that turning off auto mode and using block on SearchBar causes it is still probably cause for concern.

What's the expected result?

SearchBar should stay focused.

Link to Minimal Reproducible Example

https://github.com/spacedriveapp/spacedrive/tree/to-the-moon

Participation

github-actions[bot] commented 6 months ago

Thanks for opening this issue! A maintainer will review it soon.

tobySolutions commented 6 months ago

Hey there @Brendonovich, thanks for raising this, but, at the moment active work is being put in to resolve these issues in the next release of Million, so, for this isn't a huge problem as such.

Also, if you're using Auto mode, what was the use of using the block() function, still?

tobySolutions commented 6 months ago

@Aslemammad can provide more insight on this, though

github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days.