From 1c702d5f07ace011ea2b9c7b91b97ea1c2ab3478 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 17 Apr 2023 15:58:14 +0100 Subject: [PATCH] Improve a few design issues --- .../src/components/sheet/cells/OptionsCell.svelte | 7 ++++--- .../src/components/sheet/cells/RelationshipCell.svelte | 2 +- .../frontend-core/src/components/sheet/stores/scroll.js | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/frontend-core/src/components/sheet/cells/OptionsCell.svelte b/packages/frontend-core/src/components/sheet/cells/OptionsCell.svelte index a1b2f797c2..37c37fcd70 100644 --- a/packages/frontend-core/src/components/sheet/cells/OptionsCell.svelte +++ b/packages/frontend-core/src/components/sheet/cells/OptionsCell.svelte @@ -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]) } } } diff --git a/packages/frontend-core/src/components/sheet/cells/RelationshipCell.svelte b/packages/frontend-core/src/components/sheet/cells/RelationshipCell.svelte index afe1334a25..df53d452ee 100644 --- a/packages/frontend-core/src/components/sheet/cells/RelationshipCell.svelte +++ b/packages/frontend-core/src/components/sheet/cells/RelationshipCell.svelte @@ -356,7 +356,7 @@ white-space: nowrap; text-overflow: ellipsis; } - .focused .badge span:hover { + .focused .values .badge span:hover { cursor: pointer; text-decoration: underline; } diff --git a/packages/frontend-core/src/components/sheet/stores/scroll.js b/packages/frontend-core/src/components/sheet/stores/scroll.js index 6864361300..bdf72186ad 100644 --- a/packages/frontend-core/src/components/sheet/stores/scroll.js +++ b/packages/frontend-core/src/components/sheet/stores/scroll.js @@ -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) {