Skip to content

Commit

Permalink
remove console.logs
Browse files Browse the repository at this point in the history
  • Loading branch information
speedpro committed Dec 3, 2023
1 parent 696c305 commit 233df89
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions packages/ui/src/components/va-textarea/VaTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,25 +116,23 @@ export default defineComponent({
const isResizable = computed(() => {
return props.resize && !props.autosize
})
const textareaHeight = ref('auto')
const updateTextareaHeight = () => {
if (!textarea.value) {
return false
}
console.log('updateTextareaHeight')
textarea.value.style.height = '0'
const scrollHeight = textarea.value?.scrollHeight
const totalHeight = textarea.value?.scrollHeight
const lineHeight = parseInt(
window.getComputedStyle(textarea.value)?.lineHeight,
10,
)
let rows = scrollHeight / lineHeight
console.log('scrollHeight', scrollHeight)
console.log('lineHeight', lineHeight)
console.log('rows', rows)
console.log('Rounded Rows = ', Math.round(scrollHeight / lineHeight))
let rows = totalHeight / lineHeight
if (props.maxRows) {
rows = Math.max(props.minRows, Math.min(rows, props.maxRows))
Expand All @@ -146,8 +144,6 @@ export default defineComponent({
const height = rows * lineHeight + 'px'
console.log('height = ', height)
textareaHeight.value = '' + height
}
Expand Down

0 comments on commit 233df89

Please sign in to comment.