Skip to content

Releases: UdaySravanK/RNSwipeButton

Improved a11y support

24 Jan 02:35
Compare
Choose a tag to compare
  • Updated the entire button to receive and act as a normal button instead of just dragable thumb.
  • Switching from a11y to normal or vice-versa is not detecting the isA11yEnabled value correctly. So, reading the value again in on Focus.
  • Made changes to make the button work better in a11y mode. However, testing with iOS simulator is not going well. A11y status listener event name 'change' has been deprecated. So, updated it to the latest value.

forceCompleteSwipe & reduced package size

23 Jan 05:30
Compare
Choose a tag to compare
  • Added 2 new props to support the force complete functionality.
    By using the callback approach, now the swipe gesture can be completed programmatically. This will be helpful to persist the button state a completed operation. When there is a orientation change, the button state will be updated. By using the force complete, we can now show the button as in completed state. Updated the documentation.

  • Pass a boolean to indicate how the swipe completed.
    Passing a boolean to onSwipeSuccess callback to indicate whether the swipe completed with a real gesture or programmatically using forceCompleteSwipe.

  • This would give us more control to differentiate certain operations in the swipe complete callback.

  • Reduced the npm published package size by excluding a lot of unnecessary files.

v2.0.0 v2.0.2
Unpacked Size 42.6 kB 32.7 kB
Total Files 25 10

Warning Fixes, Dependency upgrades and 2 lines title support

10 Nov 08:40
ffdfcf6
Compare
Choose a tag to compare
  • Upgraded the react and react-native min required dependencies
  • Fixed code analysis warnings. Deprecated defaultProps and thumIconComponent type error.
  • Added support to set the max number of lines

Handle the deprecated removeEventListener

13 Sep 05:48
a7a1aaa
Compare
Choose a tag to compare

Patch release v1.3.8 fixes issue #92

New prop titleMaxFontScale

17 Jul 01:39
Compare
Choose a tag to compare

#68 Supporting large font size

  • Introduced a new prop "titleMaxFontScale" to support large font scaling

New prop thumbIconWidth

17 Jul 01:28
Compare
Choose a tag to compare
  • #58 Introduced new prop "thumbIconWidth" to adjust the width of thumb icon
  • #65 Corrected prop name in TS type definitions

Screen Shot 2021-07-16 at 20 27 33

New prop disableResetOnTap

17 Jul 01:26
Compare
Choose a tag to compare

Fixed git issue #49: Prevent returning to initial state

  • Adding a new prop called disableResetOnTap. After swipe success, tap on button resets it. This behavior can be disabled by setting this prop to true.

Use updated props in PanResponder callbacks

25 Dec 21:43
3aa6e77
Compare
Choose a tag to compare

Issue: Using useRef memoizes initial disable value. So the swipe functionality continues to work though the disabled prop is set as true.
Fix: Use useCallback instead of useRef to update PanResponder callbacks every time props update

Example:

const MyComponent = (props) => {
  const [disableSwipeButton, setDisableSwipeButton] = useState(false)
  return (
    <div>
      <RNSwipeButton disabled={disableSwipeButton} />
      <Button onPress={() => setDisableSwipeButton(!disableSwipeButton)} title="Toggle disable" />
    </div>
  )
}

railStyles defect fix

30 Sep 01:50
Compare
Choose a tag to compare

This release has

  • railStyles prop is not overriding thumb rail container styles. Due to which unable to match the rail styles with button container styles. With this release developer will get full control to style the thumb rail container.

Example code snippet:

<SwipeButton 
  containerStyles={{ borderRadius: 5 }}
  railStyles={{ borderRadius: 5 }}
/>

Right to left (RTL) layouts support

30 Sep 01:17
Compare
Choose a tag to compare

This release has

  • Fix for issue #38
  • enableRightToLeftSwipe prop has been renamed to enableReverseSwipe, so it makes sense for both LTR and RTL layouts.
  • Out of the box support for RTL layouts.
    If RTL is enabled at OS settings (by selecting languages like Arabic) then the rn-swipe-button works automatically as right to left swipe. To change it back to left to right swipe, prop enableReverseSwipe can be used.