@codeleap/mobile 3.20.1 → 3.21.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": "@codeleap/mobile",
3
- "version": "3.20.1",
3
+ "version": "3.21.0",
4
4
  "main": "src/index.ts",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -43,7 +43,7 @@ export type PagerProps = React.PropsWithChildren<{
43
43
  renderPageWrapper?: React.FC<PageProps>
44
44
  pageWrapperProps?: any
45
45
  width?: number
46
- onScroll?: (event: ScrollEvent, args: { isLeft: boolean; isRight: boolean; x: number }) => void
46
+ onScroll?: (event: ScrollEvent, args: { isLeft?: boolean; isRight?: boolean; x?: number }) => void
47
47
  /** If TRUE render page, nextPage and prevPage only */
48
48
  windowing?: boolean
49
49
  scrollRightEnabled?: boolean
@@ -157,10 +157,13 @@ export const Pager = (pagerProps: PagerProps) => {
157
157
  }, [childArr, page, setPage, waitEventDispatch.current])
158
158
 
159
159
  const handleScroll = (event: ScrollEvent) => {
160
- if (!scrollEnabled) return null
161
-
162
160
  const scrollX = event?.nativeEvent?.contentOffset?.x
163
161
 
162
+ if (!scrollEnabled) {
163
+ if (TypeGuards.isFunction(onScroll)) onScroll?.(event, { x: scrollX })
164
+ return null
165
+ }
166
+
164
167
  if (!_scrollEnabled) {
165
168
  setScrollPositionX(scrollX)
166
169
  return null
@@ -196,6 +196,7 @@ const TextInputComponent = forwardRef<NativeTextInput, TextInputProps>((props, i
196
196
  value={value}
197
197
  selectionColor={selectionColor}
198
198
  secureTextEntry={password && secureTextEntry}
199
+ textAlignVertical={isMultiline ? 'top' : undefined}
199
200
  {...textInputProps}
200
201
  onBlur={handleBlur}
201
202
  onFocus={handleFocus}
@@ -209,7 +210,6 @@ const TextInputComponent = forwardRef<NativeTextInput, TextInputProps>((props, i
209
210
  ]}
210
211
  ref={innerInputRef}
211
212
  pointerEvents={isPressable ? 'none' : undefined}
212
- textAlignVertical={isMultiline ? 'top' : undefined}
213
213
  {...maskingExtraProps}
214
214
  />
215
215
  </InputBase>