Conversation
|
Depends on #909 |
2115994 to
eefd43b
Compare
packages/design-system-react-native/src/components/TextField/TextField.tsx
Show resolved
Hide resolved
packages/design-system-react-native/src/components/TextField/TextField.tsx
Outdated
Show resolved
Hide resolved
| isStateStylesDisabled | ||
| twClassName="bg-transparent border-0" | ||
| /> | ||
| )} |
There was a problem hiding this comment.
Custom inputElement ignores TextField props
High Severity
When inputElement is provided, TextField renders it directly without forwarding any props or ref. This means props like isDisabled, autoFocus, placeholder, and value are silently ignored, and the forwarded ref returns null. The TypeScript types accept these props but they have no effect at runtime, violating the component's API contract and breaking expected functionality.
6db100f to
df9901f
Compare
| ref, | ||
| () => inputRef.current, | ||
| [], | ||
| ); |
There was a problem hiding this comment.
Forwarded ref can become stale
Medium Severity
useImperativeHandle(ref, () => inputRef.current, []) only runs once, so the exposed ref value can get stuck as the initial inputRef.current. If the inner Input ever remounts (or inputElement toggles on/off), external callers may keep a null/old TextInput ref and focus()/imperative calls won’t work.
| style={[containerStyle, style]} | ||
| onPress={onPressHandler} | ||
| accessible={false} | ||
| > |
There was a problem hiding this comment.
testID targets Pressable not TextInput
Low Severity
testID is applied to the outer Pressable instead of the actual input element. This can break callers/tests that expect testID to identify the TextInput (e.g., for typing, asserting editable, or querying input-specific props), especially since Input commonly uses testID directly on TextInput.
## Release 23.0.0 This release includes typography updates for improved text hierarchy and the new TextField component for React Native. ### 📦 Package Versions - `@metamask/design-tokens`: **8.2.2** - `@metamask/design-system-react`: **0.9.1** - `@metamask/design-system-react-native`: **0.9.0** ### 🎨 Design Token Updates #### Typography Scale Refinement (#936) Updated the typography scale for improved text hierarchy across all platforms: **What Changed:** - `fontSize.5` increased from 18px to 20px, affecting `HeadingMd`, `SectionHeading`, `BodyLg`, and `ButtonLabelLg` typography tokens - `SectionHeading` on large screens now uses 24px (up from 20px) to maintain consistent hierarchy with `HeadingMd` - Typography documentation updated to reflect the refined sizes **Impact:** - Better visual hierarchy for section and page headings - Improved consistency across responsive breakpoints - More maintainable type scale with fewer similar sizes ### ⚛️ React Web Updates (0.9.1) #### Changed - Updated `Text` component typography sizes for improved text hierarchy (#936) - `TextVariant.HeadingMd` and `TextVariant.SectionHeading` now use 20px on small screens (up from 18px) - `TextVariant.SectionHeading` now uses 24px on large screens (up from 20px) for consistent hierarchy with `HeadingMd` - `TextVariant.BodyLg` and `TextVariant.ButtonLabelLg` also updated to 20px - Typography documentation updated for accuracy ### 📱 React Native Updates (0.9.0) #### Added - Added `TextField` component for text input fields (#910) - Boxed, press-to-focus wrapper around `Input` component - Supports configurable sizes, optional start/end accessories - Includes error and disabled states with custom styling - Full accessibility support and comprehensive test coverage ### ✅ Checklist - [x] Changelogs updated with human-readable descriptions - [x] Changelog validation passed (`yarn changelog:validate`) - [x] Version bumps follow semantic versioning - design-tokens: patch (8.2.1 → 8.2.2) - typography refinement - design-system-react: patch (0.9.0 → 0.9.1) - component update using new tokens - design-system-react-native: minor (0.8.0 → 0.9.0) - new TextField component - [x] No breaking changes - [x] PR references included in changelog entries <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Primarily version/changelog updates; the only functional impact described is typography token/`Text` sizing tweaks and a new RN `TextField` component, which may affect UI layout but not security-critical logic. > > **Overview** > Bumps the monorepo release to `23.0.0` and updates package versions: `@metamask/design-tokens` `8.2.1`→`8.2.2`, `@metamask/design-system-react` `0.9.0`→`0.9.1`, and `@metamask/design-system-react-native` `0.8.0`→`0.9.0`. > > Changelogs are updated to document **typography scale adjustments** (notably `fontSize.5` 18px→20px and larger `SectionHeading` on large screens) and the corresponding `Text` variant size updates in React, plus the addition of a new React Native `TextField` component. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit efba7fa. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->


Description
Added
TextFieldcomponent.Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/DSYS-278
Manual testing steps
TextFieldexampleScreenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Adds a new interactive input wrapper with custom focus/disabled/error styling and press-to-focus behavior; risk is moderate due to potential UI/UX regressions and event-handling edge cases, but changes are additive with dedicated tests and Storybook coverage.
Overview
Introduces a new
TextFieldcomponent to the React Native design system: a boxed, press-to-focus wrapper aroundInputwith configurable sizes, optional start/end accessories, error and disabled states, and style overrides viatwClassName/style.Exports
TextField/TextFieldSize, adds a full Storybook story set (and wires it into the RN Storybook requires file), includes comprehensive unit tests for styling/state/handlers/ref forwarding, and adds component documentation inTextField/README.md.Written by Cursor Bugbot for commit ad2eb69. This will update automatically on new commits. Configure here.