Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt ComboBox selectedItem prop #3749

Merged
merged 1 commit into from
Nov 8, 2024

Commits on Nov 7, 2024

  1. Adopt ComboBox selectedItem prop

    Remove previous workaround and adopt the `selectedItem` prop to
    make the `ComboBox` component fully controlled.
    
    To avoid the previous issue where the ComboBox would get into a loop
    or cause the tests to crash due to OOM, we memoise the value passed
    to `selectedItem` to ensure the same reference is kept if the value
    is unchanged, e.g. in case of a selected namespace:
    `{ id: namespace, text: namespace }`
    we memoise on the `id` field so the same object is returned unless
    the namespace changes. This avoid the ComboBox unnecessarily
    re-rendering, and also handles the case of translated text for the
    'All namespaces' option.
    AlanGreene committed Nov 7, 2024
    Configuration menu
    Copy the full SHA
    9fcd512 View commit details
    Browse the repository at this point in the history