[ui] fix Editable overflow, disable button unless dirty
parent
ddfe103e7a
commit
ad5cb6036d
|
@ -3,6 +3,7 @@
|
||||||
import { createEventDispatcher } from "svelte";
|
import { createEventDispatcher } from "svelte";
|
||||||
import type { IValue } from "upend/types";
|
import type { IValue } from "upend/types";
|
||||||
import IconButton from "./IconButton.svelte";
|
import IconButton from "./IconButton.svelte";
|
||||||
|
import { isEqual } from "lodash";
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
export let editable: boolean;
|
export let editable: boolean;
|
||||||
|
@ -18,6 +19,7 @@
|
||||||
</div>
|
</div>
|
||||||
<IconButton
|
<IconButton
|
||||||
name="check-circle"
|
name="check-circle"
|
||||||
|
disabled={isEqual(value, newValue)}
|
||||||
on:click={() => dispatch("edit", newValue)}
|
on:click={() => dispatch("edit", newValue)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -33,5 +35,6 @@
|
||||||
|
|
||||||
.selector {
|
.selector {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue