Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Remove the initial resize on mount. This code doesn’t work

Tianzhou Chen44218200f4c9
diff --git a/frontend/src/bbkit/BBAutoResize.vue b/frontend/src/bbkit/BBAutoResize.vue
index 0f41892860..ad7fe046ce 100644
--- a/frontend/src/bbkit/BBAutoResize.vue
+++ b/frontend/src/bbkit/BBAutoResize.vue
@@ -1,36 +1,21 @@
<template>
- <div ref="control">
+ <div>
<slot name="main" :resize="resize" />
</div>
<slot name="accessory" :resize="resize" />
</template>
<script lang="ts">
-import { onMounted, nextTick, ref } from "vue";
-
export default {
name: "ResizeAuto",
setup(props, ctx) {
- const control = ref();
-
- onMounted(() => {
- nextTick(() => {
- control.value.setAttribute(
- "style",
- "height",
- // Extra 2px is to prevent jiggling upon entering the text
- `${control.value.scrollHeight + 2}px`
- );
- });
- });
-
const resize = (el: HTMLTextAreaElement) => {
el.style.height = "auto";
+ // Extra 2px is to prevent jiggling upon entering the text
el.style.height = `${el.scrollHeight + 2}px`;
};
return {
- control,
resize,
};
},