Skip to content

Commit

Permalink
adjust changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrCherry97 committed Oct 5, 2023
1 parent 5f48ec0 commit 00dcd9a
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/shared/ResourceForm/inputs/ComboboxInput.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import classnames from 'classnames';
import {
ComboBox as UI5ComboBox,
ComboBoxItem,
} from '@ui5/webcomponents-react';
import { ComboBox, ComboBoxItem } from '@ui5/webcomponents-react';

export function ComboboxInput({
value,
Expand All @@ -24,16 +21,15 @@ export function ComboboxInput({
className,
)}
>
<UI5ComboBox
<ComboBox
ariaLabel="Combobox input"
id={id || 'combobox-input'}
ref={_ref}
disabled={props.disabled || !options?.length}
filter="Contains"
onChange={event => {
const selectedOption = options.find(
// eslint-disable-next-line eqeqeq
o => o.text == event.target.value,
o => o.text === event.target.value,
);
if (!selectedOption) return;
if (onSelectionChange) {
Expand All @@ -47,16 +43,16 @@ export function ComboboxInput({
}
}}
value={
// eslint-disable-next-line eqeqeq
options.find(o => o.key == value || o.key == selectedKey)?.text ?? ''
options.find(o => o.key === value || o.key === selectedKey)?.text ??
''
}
placeholder={placeholder}
{...props}
>
{options.map(option => (
<ComboBoxItem id={option.key} text={option.text} />
))}
</UI5ComboBox>
</ComboBox>
</div>
);
}

0 comments on commit 00dcd9a

Please sign in to comment.