Skip to content

Commit e8bd7eb

Browse files
committed
fix create on empty table
1 parent be480f3 commit e8bd7eb

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-generic-crud-table",
3-
"version": "1.5.7",
3+
"version": "1.5.8",
44
"description": "<crud-table> renders object-arrays with options-panel and inline edit per row. Dispatches events for ongoing data handling. As self-containing webcomponent or for Svelte in 60KB",
55
"main": "dist/build/crud-table.js",
66
"module": "dist/build/crud-table.mjs",

src/SvelteGenericCrudTable.svelte

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@
140140
<main>
141141
<!-- /* istanbul ignore next line */ -->
142142
<h3>{name}</h3>
143+
<!-- /* istanbul ignore next line */ -->
144+
{#if table_data.length === 0}
145+
{#if options.includes(CREATE)}
146+
<div class="blue" on:click={handleCreate}
147+
title="Create">
148+
{@html iconcreate}
149+
</div>
150+
{/if}
151+
{/if}
143152
{#if (table_data !== undefined)}
144153
<!-- /* istanbul ignore next line */ -->
145154
{#if Array.isArray(table_data)}
@@ -400,9 +409,7 @@
400409
max-height: 1.3em;
401410
}
402411
403-
input:focus,
404-
textarea:focus,
405-
select:focus {
412+
textarea:focus {
406413
outline: none;
407414
font-weight: 300;
408415
white-space: normal;

0 commit comments

Comments
 (0)