@klyftig/mobile-ui 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klyftig/mobile-ui",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "scripts": {
5
5
  "test": "jest",
6
6
  "sync": "bash scripts/sync-to-kaelo.sh",
@@ -35,6 +35,12 @@ interface GlassInputProps {
35
35
  onFocus?: () => void;
36
36
  onBlur?: () => void;
37
37
  selectTextOnFocus?: boolean;
38
+ // The keyboard's return key: what it says, what it does, and whether it
39
+ // dismisses the keyboard. An "add" field (type a name, press ✓, type the
40
+ // next) passes `blurOnSubmit={false}` so the keyboard stays up.
41
+ returnKeyType?: 'done' | 'go' | 'next' | 'search' | 'send';
42
+ onSubmitEditing?: () => void;
43
+ blurOnSubmit?: boolean;
38
44
  // Overrides the outer container (label + field). Its default `marginBottom: 16`
39
45
  // suits stacked forms; screens with their own section rhythm pass
40
46
  // `{ marginBottom: 0 }` so spacing is owned by the layout, not the input.
@@ -74,6 +80,9 @@ const GlassInputComponent: React.FC<GlassInputProps> = ({
74
80
  onFocus,
75
81
  onBlur,
76
82
  selectTextOnFocus,
83
+ returnKeyType,
84
+ onSubmitEditing,
85
+ blurOnSubmit,
77
86
  multiline = false,
78
87
  numberOfLines,
79
88
  autoGrow = false,
@@ -147,6 +156,9 @@ const GlassInputComponent: React.FC<GlassInputProps> = ({
147
156
  onBlur={handleBlur}
148
157
  onContentSizeChange={isAutoGrow ? handleContentSizeChange : undefined}
149
158
  selectTextOnFocus={selectTextOnFocus}
159
+ returnKeyType={returnKeyType}
160
+ onSubmitEditing={onSubmitEditing ? () => onSubmitEditing() : undefined}
161
+ submitBehavior={blurOnSubmit === false ? 'submit' : undefined}
150
162
  selection={!isFocused && !multiline ? SELECTION_START : undefined}
151
163
  multiline={multiline}
152
164
  numberOfLines={numberOfLines}