Skip to content

Commit

Permalink
fix: InputLabel props
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 committed Oct 4, 2024
1 parent c410b58 commit 8f6eded
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 1 addition & 3 deletions apps/desktop/src/lib/branch/BranchLabel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
}
let { name, disabled = false, onChange }: Props = $props();
let inputEl = $state<HTMLInputElement>();
</script>

<LabelInput bind:inputEl class="text-14 text-bold" value={name} {disabled} {onChange} />
<LabelInput class="text-14 text-bold" value={name} {disabled} {onChange} />
11 changes: 6 additions & 5 deletions apps/desktop/src/lib/shared/LabelInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
placeholder?: string;
class?: string;
multiline?: boolean;
inputEl?: HTMLInputElement | HTMLTextAreaElement;
}
let {
value,
placeholder,
disabled = false,
onChange,
inputEl = $bindable(),
class: className = '',
multiline = false
}: Props = $props();
Expand All @@ -27,6 +25,8 @@
let textAreaWidth = $state('');
let inputWidth = $state('');
let inputHeight = $state('');
let inputEl = $state<HTMLInputElement | HTMLTextAreaElement>();
</script>

<span
Expand All @@ -37,8 +37,9 @@
class="label-input-measure-el"
class:text-12={multiline}
class:text-14={!multiline}
class:text-bold={!multiline}
class:wrap={multiline}
style:width={multiline ? textAreaWidth : 'inherit'}
style:width={multiline ? textAreaWidth : 'auto'}
>
{value}
</span>
Expand Down Expand Up @@ -118,14 +119,14 @@
.label-input-measure-el,
.label-input {
min-width: 44px;
padding: 2px 4px;
min-height: 20px;
padding: 2px 4px;
border: 1px solid transparent;
}
.label-input-measure-el {
pointer-events: none;
visibility: hidden;
border: 1px solid transparent;
border: 2px solid transparent;
color: black;
position: fixed;
display: inline-block;
Expand Down

0 comments on commit 8f6eded

Please sign in to comment.