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

[Bugfix] Dropdown: ensure reactivity of components 'selectedItem' prop #1111

Merged
merged 9 commits into from
Jun 25, 2024
Prev Previous commit
Next Next commit
fix linting error
  • Loading branch information
skykanin committed Jun 17, 2024
commit 887d492d9cb9557efd67c23e5f869d99ce0f540a
2 changes: 1 addition & 1 deletion src/components/Dropdown/index.jsx
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ const Dropdown = ({ className, header, icon, items, onSelect, open, placeholder,

const [isOpen, setOpen] = useState(open);
const [availableOptions, filterAvailableOptions] = useState(items || []);
const DEFAULT_ITEM = { title: '', id: '' }
const DEFAULT_ITEM = { title: '', id: '' };
const [selectedOption, selectItem] = useState(selectedItem || DEFAULT_ITEM);
const [activeOption, setActiveOption] = useState(selectedItem || DEFAULT_ITEM);
const [inputFieldValue, updateInputValue] = useState('');