Skip to content

Expose autoResize in Textarea.vue#6120

Open
Ken-vdE wants to merge 1 commit intonuxt:v4from
Ken-vdE:patch-1
Open

Expose autoResize in Textarea.vue#6120
Ken-vdE wants to merge 1 commit intonuxt:v4from
Ken-vdE:patch-1

Conversation

@Ken-vdE
Copy link

@Ken-vdE Ken-vdE commented Feb 28, 2026

Be able to call autoResize without forcefully triggering an Input (which could have other functional implications e.g. making api requests on input events).

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Say you have a Textarea containing text and the window is resized; the autoResize will not be triggered (there are other cases too).
This change will allow you to do something like this:

const resizeDebouncer = useDebounceFn(() => {
    textareaTemplateRef.value.autoResize();
}, 500);
onMounted(() => {
    window.addEventListener('resize', resizeDebouncer);
});
onUnmounted(() => {
    window.removeEventListener('resize', resizeDebouncer);
});

Without manually triggering, say, an input event, which could have other implications when using a manual @update:modelValue"...".

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Be able to call autoResize without forcefully triggering an Input (which could have other functional implications e.g. making api requests on input events).
@github-actions github-actions bot added the v4 #4488 label Feb 28, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fcdb231 and 53ec429.

📒 Files selected for processing (1)
  • src/runtime/components/Textarea.vue

📝 Walkthrough

Walkthrough

The defineExpose block in the Textarea component has been modified to expose an additional internal function. The component now exposes both textareaRef and autoResize to external consumers, whereas previously only textareaRef was exposed. This change extends the public API surface of the component to include the resize functionality.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Expose autoResize in Textarea.vue' directly and accurately describes the main change: exposing the autoResize function via the component's public API.
Description check ✅ Passed The description is clearly related to the changeset, explaining the rationale for exposing autoResize and providing usage examples of how it solves the problem of resizing without triggering input events.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 28, 2026

npm i https://pkg.pr.new/@nuxt/ui@6120

commit: 1a52b36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant