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

Handle Undefined Value as Controlled Value in BAIPropertyFilter #3095

Open
yomybaby opened this issue Feb 4, 2025 — with Lablup-Issue-Syncer · 0 comments · Fixed by #2999
Open

Handle Undefined Value as Controlled Value in BAIPropertyFilter #3095

yomybaby opened this issue Feb 4, 2025 — with Lablup-Issue-Syncer · 0 comments · Fixed by #2999
Assignees

Comments

@yomybaby
Copy link
Member

yomybaby commented Feb 4, 2025

In the BAIPropertyFilter component, when the value is explicitly set to undefined, it should be treated as having no value rather than being in an uncontrolled mode. Currently, this causes issues where the component's internal state does not update when the value is changed via props from the parent, rather than being reset by the user. This issue needs to be addressed to ensure proper state management.

@yomybaby yomybaby self-assigned this Feb 4, 2025
graphite-app bot pushed a commit that referenced this issue Feb 5, 2025
…opertyFilter (#2999)

Resolves #3095 (FR-460)

## Why refactoring?
In the `BAIPropertyFilter` component, when the `value` is explicitly set to `undefined`, it should be treated as having no value rather than being in an uncontrolled mode. Currently, this causes issues where the component's internal state does not update when the `value` is changed via props from the parent, rather than being reset by the user. This issue needs to be addressed to ensure proper state management.

## Changes
Replaces `useDynamicList` with `useControllableValue` in the BAIPropertyFilter component to improve filter state management. This change:

- Introduces key-based filter tracking for more reliable tag removal
- Simplifies filter value updates through a centralized update function
- Fixes empty string handling in filter parsing
- Removes unnecessary effect hook dependencies
- Streamlines option generation for the AutoComplete component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant