-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-height b-form-textarea within a b-tab does not work #3702
Comments
This is because content of the b-tab is rendered in dom, but visually hidden. b-form-textarea checks for height on mount (and on content change), and since it is not visible ( This issue would happen anytime a You can make the b-tab lazy ( |
See this fiddle https://jsfiddle.net/hzcnykmf/ for an example |
We might be able to optionally scope the |
Many thanks Troy. The 'lazy' attribute works fine for me. It may be worthwhile adding a comment to the Auto-height section of the b-form-textarea documentation that elements contained within a b-tab would need the lazy attribute to force a caculation. |
Yeah... it would apply to things like non-lazy modals as well (anything that uses display: none or v-show) to hide and show content that may contain an auto height textarea. |
@ianfoulds PR #3937 fixes the original issue, as long as the browser has IntersectionObserver support (natively or via a polyfill). This will be available in the 2.0.0 stable release. |
When b-form-textarea is contained within a b-tab that is not initially active, the auto-height feature does not work. In the following code, Tab 1 - the initially active tab, works and the textarea is automatically resized, Tab 2 however does not resize the textarea when clicked.
This can be fixed by calling setHeight() on the b-textarea component when the tab changes but this is not a published API method and resize should occur automatically.
Vue:
JS:
The text was updated successfully, but these errors were encountered: