Skip to content

Commit

Permalink
fix: select cannot be searched (#251)
Browse files Browse the repository at this point in the history
Co-authored-by: miaqiang <[email protected]>
  • Loading branch information
miaqiang and miaqiang authored Jun 20, 2024
1 parent 25baea9 commit 46c10fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
19 changes: 2 additions & 17 deletions src/components/Select/Select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,7 @@ export default class Select extends React.Component {

renderInput = () => {
const { searchable, name, placeholder, multi } = this.props;
const { inputVisible, inputValue, value, options } = this.state;

const { inputVisible, inputValue, value } = this.state;
const multiClassName =
multi && searchable
? classNames("select-input", {
Expand All @@ -548,19 +547,6 @@ export default class Select extends React.Component {
: ""
: localePlaceholder;

let option = { label: value, value };
options.forEach((item) => {
if (item.value === value) {
option = item;
} else if (item.options) {
item.options.forEach((op) => {
if (op.value === value) {
option = op;
}
});
}
});

return (
<div className={multiClassName}>
<input
Expand Down Expand Up @@ -610,7 +596,7 @@ export default class Select extends React.Component {

renderBaseValues = () => {
const { value, inputVisible, options } = this.state;
const { multi, valueRenderer, showTip } = this.props;
const { multi, valueRenderer } = this.props;

if (multi) {
if (isEmpty(value)) {
Expand Down Expand Up @@ -639,7 +625,6 @@ export default class Select extends React.Component {
"select-value-opacity": inputVisible,
"select-multi-value": multi,
})}
title={showTip ? option?.label || "" : ""}
>
{valueRenderer ? valueRenderer(option) : option.label}
</div>
Expand Down
1 change: 0 additions & 1 deletion src/components/Select/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
display: inline-flex;
align-items: center;
max-width: 100%;
z-index: 1;
@include TypographySymbolText;
@include ellipsis;
}
Expand Down

0 comments on commit 46c10fb

Please sign in to comment.