Improve a few design issues

This commit is contained in:
Andrew Kingston 2023-04-17 15:58:14 +01:00
parent 730fe0a8ea
commit 1c702d5f07
3 changed files with 7 additions and 6 deletions

View File

@ -45,10 +45,11 @@
onChange(option === value ? null : option)
close()
} else {
if (values.includes(option)) {
onChange(values.filter(x => x !== option))
const sanitizedValues = values.filter(x => options.includes(x))
if (sanitizedValues.includes(option)) {
onChange(sanitizedValues.filter(x => x !== option))
} else {
onChange([...values, option])
onChange([...sanitizedValues, option])
}
}
}

View File

@ -356,7 +356,7 @@
white-space: nowrap;
text-overflow: ellipsis;
}
.focused .badge span:hover {
.focused .values .badge span:hover {
cursor: pointer;
text-decoration: underline;
}

View File

@ -1,6 +1,6 @@
import { writable, derived, get } from "svelte/store"
import { tick } from "svelte"
import { SheetPadding, GutterWidth } from "../lib/constants"
import { SheetPadding, GutterWidth, DefaultRowHeight } from "../lib/constants"
export const createStores = () => {
const scroll = writable({
@ -138,7 +138,7 @@ export const initialise = context => {
const $scroll = get(scroll)
const $bounds = get(bounds)
const $rowHeight = get(rowHeight)
const verticalOffset = $rowHeight * 1.5
const verticalOffset = DefaultRowHeight * 1.5
// Ensure vertical position is viewable
if ($focusedRow) {