Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/select-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/fuselage': patch
---

Remove unsafe SelectOption casting and widen the value type to string | number.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const PaginatedSelect = ({

const internalChangedByClick = useStableCallback(([value]: OptionType) => {
setInternalValue(value);
onChange(value as SelectOption[0]); // FIXME
onChange(value); // FIXME
hide();
});

Expand Down
4 changes: 2 additions & 2 deletions packages/fuselage/src/components/Select/SelectLegacy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const SelectLegacy = forwardRef<HTMLInputElement, SelectProps>(
const internalChangedByKeyboard = useStableCallback(
([value]: OptionType) => {
setInternalValue(value);
onChange(value as SelectOption[0]); // FIXME
onChange(value); // FIXME
},
);

Expand Down Expand Up @@ -121,7 +121,7 @@ const SelectLegacy = forwardRef<HTMLInputElement, SelectProps>(

const internalChangedByClick = useStableCallback(([value]: OptionType) => {
setInternalValue(value);
onChange(value as SelectOption[0]); // FIXME
onChange(value); // FIXME
removeFocusClass();
hide();
});
Expand Down