Skip to content

Commit 6ec1bff

Browse files
committed
Simplified recommendation for fill on entrance
1 parent 9f422d4 commit 6ec1bff

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

packages/interact-validate/src/semantic/recommendedPatterns.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Path, SemanticIssue, AnyEffect, AnyInteraction } from '../types';
22
import { RETRIGGER_TYPES } from '../types';
3-
import { targetsSameElementAsSource } from './fouc';
43

54
function isKeyframeEffect(effect: AnyEffect): boolean {
65
return !!(effect.namedEffect || effect.keyframeEffect);
@@ -38,18 +37,12 @@ export function checkRecommendedFill(
3837
if (!isKeyframeEffect(effect)) return [];
3938
if (effect.fill === 'backwards' || effect.fill === 'both') return [];
4039

41-
const sameElement = targetsSameElementAsSource(owner, effect);
42-
if (sameElement && !effect.delay) return [];
43-
const timing = sameElement
44-
? 'during its delay'
45-
: 'before the animation starts on a target without FOUC hiding rules';
46-
4740
return [
4841
{
4942
code: 'custom',
5043
params: { domainCode: 'RECOMMENDED_FILL_BACKWARDS' },
5144
path: [...path, 'fill'],
52-
message: `Include \`fill: 'backwards'\` (or \`'both'\` when the final keyframe must persist) so the starting keyframe applies ${timing}.`,
45+
message: `Include \`fill: 'backwards'\` (or \`'both'\` when the final keyframe must persist) so the starting keyframe applies before the animation starts on a target without FOUC hiding rules.`,
5346
severity: 'info',
5447
},
5548
];

0 commit comments

Comments
 (0)