vue-slide-up-down | Like jQuery 's slideUp/slideDown , but for Vue | Router library
kandi X-RAY | vue-slide-up-down Summary
kandi X-RAY | vue-slide-up-down Summary
Like jQuery's slideUp/slideDown, but for Vue!
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vue-slide-up-down
vue-slide-up-down Key Features
vue-slide-up-down Examples and Code Snippets
Community Discussions
Trending Discussions on vue-slide-up-down
QUESTION
The vue-slide-up-down plugin appends the attribute hidden
to target element to hide it. According documentation, this method is preferred:
"use-hidden" propertyWhether to apply the "hidden" attribute to the element when closed. Defaults to true. This hides the component from the screen and from assistive devices. The internal elements of the component are completely invisible, and cannot be focused on (by a keyboard or assistive device). (This is probably what you want!) If you need, set this property to false to not use the hidden attribute. This could be used if you wanted to have a min-height requirement on your component. Note that this can create accessibility issues, specifically for users with a keyboard or screen reader.
The problem is the element with hidden
attribute obeys to Schrödinger paradox: "this elements is existing, but in the same time not existing". Below example shows what it means.
- When the ".ControlsGroup" (designated by blue) is visibly last, it must provide the vertical space
l1
below self inside ".Container" (designated by light yellow):
- When the ".ErrorsContainer" (designated by orange) is visible, it must retire
l2
px from ".ControlsGroup" and provide vertical spacel3
below self:
The usage of padding-bottom of container is not allowed because basically we don't know at advance what will be placed inside ".ControlsGroup", so each element MUST know:
- How much to retire from specific previous element
- How much of vertical space it needs to provide below self when going last.
ANSWER
Answered 2021-Feb-02 at 08:33We can do some math here and consider x
where l1 + x = l2
. The idea is to always have the l1
and when the ErrorsContainer
is visible we add to it a margin-top equal to x
to get l2
instead of l1
. I will also use flexbox to avoid margin collapsing and make sure the margin add and not collapse.
I am using CSS variables to illustrate but it's not mandatory:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue-slide-up-down
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page