1
0
Fork 0
mirror of synced 2024-09-14 00:08:25 +12:00

expand block when header is clicked

This commit is contained in:
Peter Clement 2023-11-21 10:04:49 +00:00
parent 0d32ab77ae
commit 7ed273e158

View file

@ -97,6 +97,7 @@
class:typing={typing && !automationNameError} class:typing={typing && !automationNameError}
class:typing-error={automationNameError} class:typing-error={automationNameError}
class="blockSection" class="blockSection"
on:click={() => dispatch("toggle")}
> >
<div class="splitHeader"> <div class="splitHeader">
<div class="center-items"> <div class="center-items">
@ -138,7 +139,20 @@
on:input={e => { on:input={e => {
automationName = e.target.value.trim() automationName = e.target.value.trim()
}} }}
on:click={startTyping} on:click={e => {
e.stopPropagation()
startTyping()
}}
on:keydown={async e => {
if (e.key === "Enter") {
typing = false
if (automationNameError) {
automationName = stepNames[block.id] || block?.name
} else {
await saveName()
}
}
}}
on:blur={async () => { on:blur={async () => {
typing = false typing = false
if (automationNameError) { if (automationNameError) {