🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-detectable-overflow

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-detectable-overflow - npm Package Compare versions

Comparing version

to
0.2.0

.circleci/config.yml

1

dist/DetectableOverflow.d.ts
/// <reference types="react" />
import * as React from 'react';
export interface Props {
value: string;
tag?: string;

@@ -6,0 +5,0 @@ style?: object;

@@ -62,3 +62,3 @@ "use strict";

};
return React.createElement(tag, props, React.createElement(react_resize_detector_1.default, { handleWidth: true, onResize: this.updateState }), this.props.value);
return React.createElement(tag, props, React.createElement(react_resize_detector_1.default, { handleWidth: true, onResize: this.updateState }), this.props.children);
};

@@ -65,0 +65,0 @@ return DetectableOverflow;

{
"name": "react-detectable-overflow",
"version": "0.1.0",
"version": "0.2.0",
"description": "A React component that informs when the overflowed status is changed.",

@@ -5,0 +5,0 @@ "author": {

# React Detectable Overflow
[![Circle Status](https://circleci.com/gh/h-kanazawa/react-detectable-overflow.svg?style=shield&circle-token=bdff2eda82abf6802195c4c9935852b1f276745f)](https://circleci.com/gh/h-kanazawa/react-detectable-overflow)
[![npm version](https://badge.fury.io/js/react-detectable-overflow.svg)](https://badge.fury.io/js/react-detectable-overflow)
A React component which is able to detect changes in the state that the contents is overflowed.

@@ -21,3 +24,2 @@

|:--|:--|:--|:--|:--|
|value|true|string|||
|tag||string|element type (e.g. `'p'`, `'div'`)|'div'|

@@ -47,6 +49,5 @@ |style||object|css style of the element|{<br>width: '100%',<br>textOverflow: 'ellipsis',<br>whiteSpace: 'nowrap',<br>overflow: 'hidden',<br>}|

return (
<DetectableOverflow
value="This is a sample text."
onChange={this.handleChange}
/>
<DetectableOverflow onChange={this.handleChange}>
This is a sample text.
</DetectableOverflow>
);

@@ -59,3 +60,3 @@ }

Be careful when you change the length of `value` by onChange callback. The following code perhaps causes the infinite loop of changing `isOverflowed` state.
Be careful when you change the length of `children` contents by onChange callback. The following code perhaps causes the infinite loop of changing `isOverflowed` state.

@@ -65,3 +66,2 @@ ```jsx

<DetectableOverflow
value={this.state.value}
onChange={(isOverflowed) => {

@@ -74,3 +74,5 @@ if (isOverflowed) {

}}
/>
>
{this.state.value}
</DetectableOverflow>
```

@@ -77,0 +79,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet