-
Notifications
You must be signed in to change notification settings - Fork 273
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
[config][animationMode]: setAnimationMode() does not work #8964
Comments
In this code from packages/base/src/config/AnimationMode.ts
the "in" operator in the if statement checks if the passed-in
the only values of
That comparison will be |
Compare the value of the passed in animationMode to the values of the AnimationMode enum (lowercase) rather than to the property (key) names (uppercase). This will make it so that explicitly passing in a mode (e.g. AnimationMode.None) or passing in the string value corresponding to a mode (e.g. "none") will correctly result in the current mode being set to the lowercase string value, which will make it possible to use setAnimationMode() to disable component animations as intended. Fixes SAP#8964
Hello colleagues, Can you take over the issue regarding setAnimationMode(), it seems there is an issue with it. Best Regards, |
Compare the value of the passed in animationMode to the values of the AnimationMode enum (lowercase) rather than to the property (key) names (uppercase). This will make it so that explicitly passing in a mode (e.g. AnimationMode.None) or passing in the string value corresponding to a mode (e.g. "none") will correctly result in the current mode being set to the lowercase string value, which will make it possible to use setAnimationMode() to disable component animations as intended. Fixes #8964
Bug Description
It is impossible to use
setAnimationMode()
to set the current animation to a valid mode.Affected Component
Any component with animations (ui5-progress-indicator, ui5-panel, ui5-carousel, etc.)
Expected Behaviour
It is expected that calling
setAnimationMode(mode)
, wheremode
is either a valid member of the AnimationMode enum/type (AnimationMode.Full
,AnimationMode.Basic
,AnimationMode.Minimal
, orAnimationMode.None
) or the corresponding string value ("full", "basic", "minimal", or "none"), would result in the current animation mode being changed to that value. This in turn is expected to modify the animation behavior of components that use animations. Specifically, setting the mode to "none" is expected to disable animations. This, however, is not the case.In the last example, while
setAnimationMode("None")
does change the currently set animation mode, it sets it to an invalid value so animations will not be disabled.Isolated Example
https://stackblitz.com/edit/js-32lj5a?file=index.js,index.html
Steps to Reproduce
Try to use
setAnimationMode(AnimationMode.None)
orsetAnimationMode("none")
to disable animations for a component (e.g. a ui5-progress-indicator) and observe that animations still occur when the state of the component changes. (See "Expected Behaviour" above or the stackblitz link for more detail.)Log Output, Stack Trace or Screenshots
No response
Priority
High
UI5 Web Components Version
1.24.3
Browser
Chrome
Operating System
No response
Additional Context
No response
Organization
No response
Declaration
The text was updated successfully, but these errors were encountered: