Skip to content
Merged
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
17 changes: 12 additions & 5 deletions src/ComboboxInput/ComboboxInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ const ComboboxInput = React.forwardRef(({
};

const handlePopoverOutsideClick = () => {
closePopover();
isExpanded && closePopover();
switch (resolvedSelectionType) {
case 'manual':
setFilterString(textInputRef?.current?.value);
Expand Down Expand Up @@ -403,7 +403,7 @@ const ComboboxInput = React.forwardRef(({
disabled={disabled}
onClick={handleInputGroupClick}
validationOverlayProps={validationOverlayProps}
validationState={!isExpanded && validationState}>
validationState={isExpanded ? null : validationState}>
<FormInput
autoComplete='off'
{...inputProps}
Expand Down Expand Up @@ -461,20 +461,26 @@ const ComboboxInput = React.forwardRef(({
}
<List
{...labelProps}
className='fd-list--dropdown'
compact={compact}
id={`${id}-listbox`}
noBorder
role='listbox'>
{filteredOptions?.length ? filteredOptions.map(option => {

const listItemClasses = classnames({
'is-selected': selectedOption?.key ? option?.key === selectedOption?.key : false
});

return (
<List.Item
className={listItemClasses}
id={`${id}-listbox-option-${option.key}`}
key={option.key}
onClick={(e) => handleOptionSelect(e, option)}
onFocus={(e) => handleOptionFocus(e, option)}
onKeyDown={(e) => handleOptionKeyDown(e, option)}
role='option'
selected={selectedOption?.key ? option?.key === selectedOption?.key : false}>
role='option'>
{renderListOption(option)}
</List.Item>
);
Expand All @@ -495,10 +501,11 @@ const ComboboxInput = React.forwardRef(({
disabled={disabled}
noArrow
onClickOutside={handlePopoverOutsideClick}
popperClassName='fd-popover__body--dropdown'
ref={popoverRef}
show={showPopover}
useArrowKeyNavigation
widthSizingType='minTarget' />
widthSizingType='maxTarget' />
</FormItem>
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/DatePicker/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class DatePicker extends Component {
compact={compact}
disabled={disabled}
validationOverlayProps={validationOverlayProps}
validationState={!this.state.isExpanded && validationState} >
validationState={this.state.isExpanded ? null : validationState} >
<FormInput
{...inputProps}
onBlur={this.handleBlur}
Expand Down
2 changes: 1 addition & 1 deletion src/MultiInput/MultiInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class MultiInput extends Component {
disabled={disabled}
onClick={this.showHideTagList}
validationOverlayProps={validationOverlayProps}
validationState={!this.state.bShowList && validationState}>
validationState={this.state.bShowList ? null : validationState}>
<div {...tagProps} className={tokenizerClassName}>
<div className='fd-tokenizer__inner'>
{this.state.tags.length > 0 && this.createTags()}
Expand Down
Binary file modified storybook-testing/__image_snapshots__/ComboboxInput-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.