mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-22 19:14:31 +03:00
BorderlessTextarea: Auto height on value changes
Update the height on value changes instead of only on input events. That way, if the value is externally updated then the height will update as well
This commit is contained in:
parent
5811a5741a
commit
41b9ed4ad7
@ -51,6 +51,15 @@
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if (ref) {
|
||||
// reference the value to trigger
|
||||
// the effect when it changes
|
||||
value;
|
||||
autoHeight(ref);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<textarea
|
||||
@ -65,7 +74,6 @@
|
||||
{placeholder}
|
||||
{readonly}
|
||||
oninput={(e) => {
|
||||
autoHeight(e.currentTarget);
|
||||
oninput?.(e);
|
||||
}}
|
||||
onfocus={(e) => {
|
||||
|
Loading…
Reference in New Issue
Block a user