Skip to content

Conversation

@Kysluss
Copy link
Collaborator

@Kysluss Kysluss commented Sep 6, 2025

The issue was caused by the Input being wrapped by an InputGroup when the loading state needed to be shown and not being wrapped by an InputGroup when the loading state did not need to be shown.

This would cause the Input to lose focus causing a bad UX. We will now always render an InputGroup and pass the endElement prop based on the isLoading prop.

For consideration:

If you have a custom icon being displayed, the loading state will still display correctly but it looks weird because you will have 2 icons on top of each other. Because of this, I am considering removing the isLoading and loadingState props in v7. These should probably be external concerns that the users control themselves.

For what it's worth, the Chakra UI Combobox component functions this way where the loading state is something controlled and displayed externally.

https://chakra-ui.com/docs/components/combobox#async-loading

This fixes #297

We will now always render an `InputGroup`
@codesandbox
Copy link

codesandbox bot commented Sep 6, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@changeset-bot
Copy link

changeset-bot bot commented Sep 6, 2025

⚠️ No Changeset found

Latest commit: 5de6bd9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@what-the-diff
Copy link

what-the-diff bot commented Sep 6, 2025

PR Summary

  • Improved Loading State Indication in AutoCompleteInputComponent
    This change refine the way we indicate to users that data is being loaded in the 'AutoCompleteInputComponent'. We now handle the loading state information more efficiently, improving the overall user experience during data loading.

  • Added Control Over Loading Icon Display
    We introduced a new variable, 'endElement', that allows us to choose which icon to display while data is being loaded - a general loading icon or a Spinner. This provides us with more flexibility in user interface design during data loading scenarios.

  • Enhanced User Interface for Data Input
    We've rearranged our 'Input' component in our user interface to be housed in an 'InputGroup'. This enables us to display our new 'endElement' variable effectively to the user, thus improving the visual feedback users receive during data loading.

@Kysluss Kysluss merged commit 22fd9f8 into main Sep 6, 2025
1 check passed
@Kysluss Kysluss deleted the 297AutoCompleteLosesFocusWhenIsLoadingChanges branch September 6, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autocomplete loses focus when setting isLoading based on external criteria

2 participants