-
Notifications
You must be signed in to change notification settings - Fork 27.4k
docs(ngShow/ngHide): add note about flicker when toggling elements #16489
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor suggetions.
LGTM otherwise.
src/ng/directive/ngShowHide.js
Outdated
* | ||
* ### Flickering when using ngShow to toggle between elements | ||
* | ||
* When using {@link ngShow} and / or {@link ngHide} to toggle between elements , it can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra whitespace before comma.
src/ng/directive/ngShowHide.js
Outdated
* ### Flickering when using ngShow to toggle between elements | ||
* | ||
* When using {@link ngShow} and / or {@link ngHide} to toggle between elements , it can | ||
* happen that both the element to show and the element to hide are visible at the same time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention that this only happens for a brief moment; it is not a permanent state.
It might also be worth mentioning that it affects some browsers (*cough* IE *cough*) more than others.
src/ng/directive/ngShowHide.js
Outdated
* There are several way to mitigate this problem: | ||
* | ||
* - {@link guide/animations#how-to-selectively-enable-disable-and-skip-animations Disable animations on the affected elements}. | ||
* - Use {@link ngIf} instead of {@link ngShow} / {@link ngHide}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, if you are toggling, ngSwitch
is more appropriate 😁
src/ng/directive/ngShowHide.js
Outdated
* - {@link guide/animations#how-to-selectively-enable-disable-and-skip-animations Disable animations on the affected elements}. | ||
* - Use {@link ngIf} instead of {@link ngShow} / {@link ngHide}. | ||
* - Use the special CSS selector `ng-hide.ng-hide-animate` to set `{display: none}` or similar on the affected elements . | ||
* - Define an animation on the affected elements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂
src/ng/directive/ngShowHide.js
Outdated
* This usually happens when the {@link ngAnimate ngAnimate module} is included, but no actual animations | ||
* are defined for {@link ngShow} / {@link ngHide}. | ||
* | ||
* There are several way to mitigate this problem: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using ng-class="{'ng-hide': expression}
?
src/ng/directive/ngShowHide.js
Outdated
* | ||
* - {@link guide/animations#how-to-selectively-enable-disable-and-skip-animations Disable animations on the affected elements}. | ||
* - Use {@link ngIf} instead of {@link ngShow} / {@link ngHide}. | ||
* - Use the special CSS selector `ng-hide.ng-hide-animate` to set `{display: none}` or similar on the affected elements . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra whitespace before the period.
707d21f
to
4ad23ca
Compare
Related to #14015
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change?
Please check if the PR fulfills these requirements
Other information: