Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-invertible-scroll-view

Package Overview
Dependencies
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-invertible-scroll-view

An invertible ScrollView for React Native

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
889
increased by58.75%
Maintainers
3
Weekly downloads
 
Created
Source

InvertibleScrollView Slack

InvertibleScrollView is a React Native scroll view that can be inverted so that content is rendered starting from the bottom, and the user must scroll down to reveal more. This is a common design in chat applications and the command-line terminals. InvertibleScrollView also supports horizontal scroll views to present content from right to left.

It conforms to ScrollableMixin so you can compose it with other scrollable components.

npm package

Installation

Use this with react-native 0.8.0-rc or later.

npm install react-native-invertible-scroll-view

Usage

Compose InvertibleScrollView with the scrollable component you would like to invert. In the case of a ListView, you would write:

var React = require('react-native');
var InvertibleScrollView = require('react-native-invertible-scroll-view');
var {
  ListView,
} = React;

// Inside of a component's render() method:
render() {
  return (
    <ListView
      renderScrollComponent={props => <InvertibleScrollView {...props} inverted />}
      dataSource={...}
      renderRow={...}
    />
  );
}

NOTE: When inverting a ListView, you must create a ListView that delegates to an InvertibleScrollView as shown above and not the other way around. Otherwise it will not be able to invert the rows and the content will look upside down. This is true for any scroll view that adds its own children, not just ListView.

Tips and Caveats

  • Horizontal scroll views are supported
  • To scroll to the bottom, call scrollTo(0) on a ref to the scroll view
  • When the scroll view is inverted, InvertibleScrollView wraps each child in a View that is flipped
  • Scroll views that add children (ex: ListViews) must delegate to InvertibleScrollViews so that the children can be properly inverted
  • List section headers are unsupported
  • Styles like padding are not corrected, so top padding will actually pad the bottom of the component
  • Properties like contentOffset and contentInset are not flipped; for example, the top inset adjusts the bottom of an inverted scroll view

Implementation

InvertibleScrollView uses a scale transformation to efficiently invert the view. The scroll view's viewport is inverted to flip the entire component, and then each child is inverted again so that the content appears unflipped.

Keywords

FAQs

Package last updated on 24 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc