Merge pull request #222 from UniversityRadioYork/marks/library-select-focus
Defocus library dropdown when adding item
This commit is contained in:
commit
9d318b201c
2 changed files with 8 additions and 2 deletions
|
@ -170,10 +170,15 @@ const Showplanner: React.FC<{ timeslotId: number }> = function({ timeslotId }) {
|
|||
])
|
||||
);
|
||||
}
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,6 +115,7 @@ export function LibraryColumn() {
|
|||
</div>
|
||||
<div className="px-2">
|
||||
<select
|
||||
id="sidebarLibrarySelect"
|
||||
className="form-control form-control-sm"
|
||||
style={{ flex: "none" }}
|
||||
value={sauce}
|
||||
|
|
Loading…
Reference in a new issue