Web:Component Added a click event on the selected item
This commit is contained in:
parent
ceb2a85979
commit
b68fbb1a4e
@ -134,7 +134,7 @@ class ComboBox extends React.Component {
|
||||
isNoFixedHeightOptions,
|
||||
hideMobileView,
|
||||
} = this.props;
|
||||
const { tabIndex, ...props } = this.props;
|
||||
const { tabIndex, onClickSelectedItem, ...props } = this.props;
|
||||
const { isOpen, selectedOption } = this.state;
|
||||
|
||||
const dropDownMaxHeightProp = dropDownMaxHeight
|
||||
@ -254,6 +254,7 @@ class ComboBox extends React.Component {
|
||||
disabled={disabled}
|
||||
backgroundColor={option.backgroundColor}
|
||||
onClick={this.optionClick.bind(this, option)}
|
||||
onClickSelectedItem={() => onClickSelectedItem?.(option)}
|
||||
fillIcon={fillIcon}
|
||||
isModern={noBorder}
|
||||
isActive={isActive}
|
||||
|
@ -31,10 +31,11 @@ const DropDownItem = (props) => {
|
||||
isActiveDescendant,
|
||||
} = props;
|
||||
|
||||
const { withToggle, checked, onClick, ...rest } = props;
|
||||
const { withToggle, checked, onClick, onClickSelectedItem, ...rest } = props;
|
||||
|
||||
const onClickAction = (e) => {
|
||||
onClick && !disabled && onClick(e);
|
||||
onClickSelectedItem && isSelected && onClickSelectedItem();
|
||||
};
|
||||
|
||||
const stopPropagation = (event) => {
|
||||
|
Loading…
Reference in New Issue
Block a user