mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
fix(modal): backdrop animation when backdropBreakpoint is 1 (#25430)
Resolves #25402
This commit is contained in:
11
core/src/components/modal/utils.spec.ts
Normal file
11
core/src/components/modal/utils.spec.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { getBackdropValueForSheet } from './utils';
|
||||||
|
|
||||||
|
describe('getBackdropValueForSheet()', () => {
|
||||||
|
it('should return a valid integer when backdropBreakpoint is 1', () => {
|
||||||
|
/**
|
||||||
|
* Issue: https://github.com/ionic-team/ionic-framework/issues/25402
|
||||||
|
*/
|
||||||
|
const backdropBreakpoint = 1;
|
||||||
|
expect(getBackdropValueForSheet(1, backdropBreakpoint)).toBe(0);
|
||||||
|
});
|
||||||
|
});
|
@ -23,7 +23,15 @@ export const getBackdropValueForSheet = (x: number, backdropBreakpoint: number)
|
|||||||
*
|
*
|
||||||
* This is simplified from:
|
* This is simplified from:
|
||||||
* m = (1 - 0) / (maxBreakpoint - backdropBreakpoint)
|
* m = (1 - 0) / (maxBreakpoint - backdropBreakpoint)
|
||||||
|
*
|
||||||
|
* If the backdropBreakpoint is 1, we return 0 as the
|
||||||
|
* backdrop is completely hidden.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
if (backdropBreakpoint === 1) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
const slope = 1 / (1 - backdropBreakpoint);
|
const slope = 1 / (1 - backdropBreakpoint);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user