Skip to content

fix: correct drop-shadow output format and filter function bugs#309

Open
YevheniiKotyrlo wants to merge 1 commit intonativewind:mainfrom
YevheniiKotyrlo:fix/filter-drop-shadow-fixes
Open

fix: correct drop-shadow output format and filter function bugs#309
YevheniiKotyrlo wants to merge 1 commit intonativewind:mainfrom
YevheniiKotyrlo:fix/filter-drop-shadow-fixes

Conversation

@YevheniiKotyrlo
Copy link
Contributor

Summary

Three fixes in src/native/styles/functions/filters.ts:

1. blurRadiusstandardDeviation in drop-shadow handler

React Native's DropShadowValue type expects standardDeviation, not blurRadius:

export type DropShadowValue = {
  offsetX: number | string;
  offsetY: number | string;
  standardDeviation?: number | string;
  color?: ColorValue | number;
};

The handler was producing { blurRadius: 6 } — React Native ignores this unrecognized property, resulting in drop shadows with zero blur.

2. ["color", "string"]["color", "color"] in drop-shadow handler

The "string" type in the shorthand handler rejects platform color objects (from currentcolor resolution). box-shadow.ts and text-shadow.ts both correctly use ["color", "color"] — this aligns the drop-shadow handler.

3. hueRotateopacity in opacity filter function (copy-paste)

The opacity function returned { hueRotate: ... } instead of { opacity: ... } — copied from the hueRotate function above it.

Changes

File Change
src/native/styles/functions/filters.ts All 3 fixes (+6/-6 lines)
src/__tests__/native/filters.test.tsx New: 7 native runtime tests for drop-shadow + opacity
src/__tests__/vendor/tailwind/filters.test.tsx Update: blurRadiusstandardDeviation in existing assertions

Test plan

  • npx jest src/__tests__/native/filters.test.tsx — 7 tests pass (drop-shadow basic, color-first, no-blur, CSS variable, runtime variable, Tailwind v4 @Property pattern, opacity key)
  • npx jest src/__tests__/vendor/tailwind/filters.test.tsx — 24 tests pass (existing, assertions updated)
  • Full suite: 995 passed, 29 failed (pre-existing babel test failures, same on main)
  • tsc --noEmit — clean
  • eslint — clean

@YevheniiKotyrlo YevheniiKotyrlo force-pushed the fix/filter-drop-shadow-fixes branch from 2a76ebc to 3d5024b Compare March 20, 2026 18:30
@YevheniiKotyrlo YevheniiKotyrlo force-pushed the fix/filter-drop-shadow-fixes branch from 3d5024b to 9b87ebe Compare March 20, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant