Defocus library dropdown when adding item
This commit is contained in:
parent
f123249331
commit
0d324ed379
1 changed files with 8 additions and 2 deletions
|
@ -86,6 +86,7 @@ function LibraryColumn() {
|
|||
</div>
|
||||
<div className="px-2">
|
||||
<select
|
||||
id="sidebarLibrarySelect"
|
||||
className="form-control form-control-sm"
|
||||
style={{ flex: "none" }}
|
||||
value={sauce}
|
||||
|
@ -218,10 +219,15 @@ const Showplanner: React.FC = function() {
|
|||
])
|
||||
);
|
||||
}
|
||||
// If we're dragging from a pseudo-column, and a search field is focused, defocus it.
|
||||
// If we're dragging from a pseudo-column,
|
||||
// and a search field or library dropdown is focused, defocus it.
|
||||
if (result.source.droppableId[0] === "$") {
|
||||
const focus = document.activeElement;
|
||||
if (focus && focus instanceof HTMLInputElement && focus.type === "text") {
|
||||
if (
|
||||
(focus && focus instanceof HTMLInputElement && focus.type === "text") ||
|
||||
(focus instanceof HTMLSelectElement &&
|
||||
focus.id === "sidebarLibrarySelect")
|
||||
) {
|
||||
focus.blur();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue