1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-10 09:13:59 +02:00

change placeholder to only render when visible

This commit is contained in:
Ian Storm Taylor
2016-07-29 12:44:08 -07:00
parent 6775657ab5
commit ecc9202db7

View File

@@ -66,6 +66,8 @@ class Placeholder extends React.Component {
render = () => {
const isVisible = this.isVisible()
if (!isVisible) return null
const { children, className } = this.props
let { style } = this.props
@@ -76,7 +78,6 @@ class Placeholder extends React.Component {
}
const styles = {
display: isVisible ? 'block' : 'none',
position: 'absolute',
top: '0px',
right: '0px',