MCPcopy Create free account
hub / github.com/ChatGPTBox-dev/chatGPTBox / updateRefHeight

Function updateRefHeight

src/utils/update-ref-height.mjs:1–11  ·  view source on GitHub ↗
(ref)

Source from the content-addressed store, hash-verified

1export function updateRefHeight(ref) {
2 ref.current.style.height = 'auto'
3 const computed = window.getComputedStyle(ref.current)
4 const height =
5 parseInt(computed.getPropertyValue('border-top-width'), 10) +
6 parseInt(computed.getPropertyValue('padding-top'), 10) +
7 ref.current.scrollHeight +
8 parseInt(computed.getPropertyValue('padding-bottom'), 10) +
9 parseInt(computed.getPropertyValue('border-bottom-width'), 10)
10 ref.current.style.height = `${height}px`
11}

Callers 1

InputBoxFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected