contentful / forma-36

A design system by Contentful

Home Page:https://f36.contentful.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› Bug - Autocomplete loading state not shown unless it has data

AndrewLeedham opened this issue Β· comments

Forma 36 bug report

Summary

When using the <Autocomplete> component with the isLoading attribute it requires items to have a value to render the "loading" dropdown. However, by the very nature of data being loaded we don't have any yet.

Environment

Arc/macOs

Steps to reproduce

This playground example shows isLoading with items as an empty array (no loading state) and adding a single undefined value (shows loading state).

Expected results

I would expect the loading state to still show with an empty array.

Actual results

The loading state is only shown if items has values.

Marking issue as stale since there was no activity for 30 days

Still an issue.

Marking issue as stale since there was no activity for 30 days

Marking issue as stale since there was no activity for 30 days

Hey @AndrewLeedham,
i double checked the behaviour, and to force showing the loading state, there is already an attribute called showEmptyList

      <Autocomplete
        isLoading
        showEmptyList
        items={[]}
        onInputValueChange={handleInputValueChange}
        onSelectItem={handleSelectItem}
      />

See working example in the Playground