Skip to content

Commit

Permalink
fix(ui5-*): Make setAnimationMode() properly change modes (#8965)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dreynol authored May 15, 2024
1 parent c690630 commit 9f5d276
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/base/src/config/AnimationMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const getAnimationMode = (): `${AnimationMode}` => {
* @param { AnimationMode } animationMode
*/
const setAnimationMode = (animationMode: `${AnimationMode}`) => {
if (animationMode in AnimationMode) {
const options: string[] = Object.values(AnimationMode);
if (options.includes(animationMode)) {
curAnimationMode = animationMode;
}
};
Expand Down

0 comments on commit 9f5d276

Please sign in to comment.