Skip to content

feat(Textarea): expose autoResize method#6120

Merged
benjamincanac merged 4 commits intonuxt:v4from
Ken-vdE:patch-1
Apr 17, 2026
Merged

feat(Textarea): expose autoResize method#6120
benjamincanac merged 4 commits intonuxt:v4from
Ken-vdE:patch-1

Conversation

@Ken-vdE
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

coderabbitai Bot commented Feb 28, 2026

📝 Walkthrough

Walkthrough

The defineExpose block in src/runtime/components/Textarea.vue was updated to expose an additional internal function. The component now exposes both textareaRef and autoResize to external consumers. The documentation page docs/content/docs/2.components/textarea.md was updated to document the new autoResize: () => void entry in the exposed template-ref API.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: exposing the autoResize method from the Textarea component.
Description check ✅ Passed The description is well-related to the changeset, explaining the motivation, use case, and implementation details of exposing the autoResize method.
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

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
Copy Markdown

pkg-pr-new Bot commented Feb 28, 2026

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

commit: 6bcadb4

@benjamincanac benjamincanac changed the title Expose autoResize in Textarea.vue feat(Textarea): expose autoResize method Mar 14, 2026
Copy link
Copy Markdown
Member

@benjamincanac benjamincanac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, however we need to update the ### Expose section in textarea.md.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/content/docs/2.components/textarea.md (1)

257-264: ⚠️ Potential issue | 🟡 Minor

Add a Soon badge to this newly introduced Expose API update.

This PR documents a new feature (autoResize exposure), so the updated docs heading should include the release-gap badge (e.g., on ### Expose) to avoid implying immediate npm availability.

As per coding guidelines: “docs/**/*.md: Add :badge{label="Soon" class="align-text-top"} to docs headings when introducing new features or fixes, as the docs deploy on merge but features ship on next npm release”.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/docs/2.components/textarea.md` around lines 257 - 264, The "###
Expose" heading for the new Expose API (showing textareaRef and autoResize) is
missing the required Soon badge; update the heading text "### Expose" to include
:badge{label="Soon" class="align-text-top"} so the docs reflect the release gap
for the new autoResize exposure (references: heading "### Expose", exported
names `textareaRef` and `autoResize` in the table).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@docs/content/docs/2.components/textarea.md`:
- Around line 257-264: The "### Expose" heading for the new Expose API (showing
textareaRef and autoResize) is missing the required Soon badge; update the
heading text "### Expose" to include :badge{label="Soon" class="align-text-top"}
so the docs reflect the release gap for the new autoResize exposure (references:
heading "### Expose", exported names `textareaRef` and `autoResize` in the
table).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bbc49413-572d-49f2-8ed5-b8ff0c4c1e4f

📥 Commits

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

📒 Files selected for processing (1)
  • docs/content/docs/2.components/textarea.md

@benjamincanac benjamincanac merged commit 9c5c0df into nuxt:v4 Apr 17, 2026
18 checks passed
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.

2 participants