Fix buttons being highlighted when filters are set
This commit is contained in:
parent
ca92d520b3
commit
554659bd91
|
@ -2,11 +2,11 @@
|
|||
import CreateColumnButton from "../CreateColumnButton.svelte"
|
||||
import { getContext, onMount } from "svelte"
|
||||
|
||||
const { rows, columns, subscribe } = getContext("sheet")
|
||||
const { rows, columns, subscribe, filter } = getContext("sheet")
|
||||
|
||||
let createColumnModal
|
||||
|
||||
$: highlighted = !$rows.length || !$columns.length
|
||||
$: highlighted = !$filter.length && (!$rows.length || !$columns.length)
|
||||
|
||||
onMount(() => subscribe("add-column", createColumnModal.show))
|
||||
</script>
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
import CreateEditRow from "../../modals/CreateEditRow.svelte"
|
||||
import { getContext } from "svelte"
|
||||
|
||||
const { rows, columns } = getContext("sheet")
|
||||
const { rows, columns, filter } = getContext("sheet")
|
||||
|
||||
$: hasCols = !!$columns.length
|
||||
$: hasRows = !!$rows.length
|
||||
$: hasRows = $rows.length || $filter.length
|
||||
</script>
|
||||
|
||||
<CreateRowButton
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
const { columns, config, filter, schema } = getContext("sheet")
|
||||
|
||||
const onFilter = e => {
|
||||
filter.set(e.detail)
|
||||
filter.set(e.detail || [])
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue