Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show search icon in edit mode if the search checkbox is on #1177

Merged
merged 4 commits into from
Mar 23, 2023
Merged
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion apis/nucleus/src/components/listbox/ListBoxInline.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function ListBoxInline({ options, layout }) {
});

const shouldAutoFocus = searchVisible && search === 'toggle';
const showSearchIcon = searchEnabled !== false && search === 'toggle' && !constraints?.active;
const showSearchIcon = searchEnabled !== false && search === 'toggle';
const showSearchOrLockIcon = isLocked || showSearchIcon;
const showIcons = showSearchOrLockIcon || isDrillDown;
const iconsWidth = (showSearchOrLockIcon ? BUTTON_ICON_WIDTH : 0) + (isDrillDown ? ICON_WIDTH + ICON_PADDING : 0); // Drill-down icon needs padding right so there is space between the icon and the title
Expand Down Expand Up @@ -290,18 +290,21 @@ function ListBoxInline({ options, layout }) {
onClick={unlock}
disabled={selectDisabled()}
size="large"
sx={{ '&.Mui-disabled': { color: '#000', opacity: 0.9 } }}
quanho marked this conversation as resolved.
Show resolved Hide resolved
>
<Lock disableRipple style={{ fontSize: '12px' }} />
</IconButton>
) : (
showSearchIcon && (
<IconButton
onClick={onShowSearch}
disabled={!!constraints?.active}
tabIndex={-1}
title={translator.get('Listbox.Search')}
size="large"
disableRipple
data-testid="search-toggle-btn"
sx={{ '&.Mui-disabled': { color: '#000', opacity: 0.9 } }}
>
<SearchIcon style={{ fontSize: '12px' }} />
</IconButton>
Expand Down