Skip to content

Commit

Permalink
perf(material): reduce resolutions
Browse files Browse the repository at this point in the history
  • Loading branch information
juanrgm committed Sep 11, 2024
1 parent fd91895 commit fe35b60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/material/src/Select/SelectInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ const SelectInput = $.defineComponent(function SelectInput(props) {
prevProps: PropsOf<MenuItemTypeMap>
) => {
let newValue: any;
const child = { props: itemProps };
const childValue = itemProps.value;

const multiple = props.multiple;
// We use the tabindex attribute to signal the available options.
Expand All @@ -411,14 +411,14 @@ const SelectInput = $.defineComponent(function SelectInput(props) {

if (multiple) {
newValue = Array.isArray(value()) ? value().slice() : [];
const itemIndex = value().indexOf(child.props.value);
const itemIndex = value().indexOf(childValue);
if (itemIndex === -1) {
newValue.push(child.props.value);
newValue.push(childValue);
} else {
newValue.splice(itemIndex, 1);
}
} else {
newValue = child.props.value;
newValue = childValue;
}

if (typeof prevProps.onClick === "function") {
Expand Down

0 comments on commit fe35b60

Please sign in to comment.