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(onBlur): suppress close popover onBlur #951

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/BaseSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ const BaseSelect = React.forwardRef((props: BaseSelectProps, ref: React.Ref<Base
defaultValue: defaultOpen,
value: open,
});

let mergedOpen = rendered ? innerOpen : false;

// Not trigger `open` in `combobox` when `notFoundContent` is empty
Expand Down Expand Up @@ -563,7 +563,6 @@ const BaseSelect = React.forwardRef((props: BaseSelectProps, ref: React.Ref<Base
const onContainerBlur: React.FocusEventHandler<HTMLElement> = (...args) => {
setMockFocused(false, () => {
focusRef.current = false;
onToggleOpen(false);
});

if (disabled) {
Expand Down Expand Up @@ -641,12 +640,11 @@ const BaseSelect = React.forwardRef((props: BaseSelectProps, ref: React.Ref<Base
}, [triggerOpen]);

// Used for raw custom input trigger
let onTriggerVisibleChange: null | ((newOpen: boolean) => void);
if (customizeRawInputElement) {
onTriggerVisibleChange = (newOpen: boolean) => {

const onTriggerVisibleChange = (newOpen: boolean) => {
onToggleOpen(newOpen);
};
}


// Close when click on non-select element
useSelectTriggerControl(
Expand Down