Skip to content

Commit

Permalink
[components] Remove react-text-ellipsis due to perf issues (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge authored Feb 26, 2018
1 parent c4063d3 commit f520138
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
1 change: 0 additions & 1 deletion packages/@sanity/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"react-portal": "^3.0.0",
"react-sortable-hoc": "^0.6.3",
"react-split-pane": "^0.1.63",
"react-text-ellipsis": "^1.2.2",
"@sanity/react-tippy": "^1.2.4",
"scroll": "^2.0.0"
},
Expand Down
14 changes: 1 addition & 13 deletions packages/@sanity/components/src/previews/DetailPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import PropTypes from 'prop-types'
import React from 'react'
import styles from 'part:@sanity/components/previews/detail-style'
import TextEllipsis from 'react-text-ellipsis'

let index = 0
const fieldProp = PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.func])
Expand Down Expand Up @@ -115,18 +114,7 @@ export default class DetailPreview extends React.PureComponent {
typeof description === 'function' && description({layout: 'detail'})
}
{
typeof description === 'string' && (
<TextEllipsis
lines={2}
tag={'span'}
ellipsisChars={'…'}
tagClass={'className'}
debounceTimeoutOnResize={200}
useJsOnly
>
{description}
</TextEllipsis>
)
typeof description === 'string' && description
}
{
typeof description === 'object' && description
Expand Down

0 comments on commit f520138

Please sign in to comment.