mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-13 02:34:05 +02:00
change placeholder to only render when visible
This commit is contained in:
@@ -66,6 +66,8 @@ class Placeholder extends React.Component {
|
|||||||
|
|
||||||
render = () => {
|
render = () => {
|
||||||
const isVisible = this.isVisible()
|
const isVisible = this.isVisible()
|
||||||
|
if (!isVisible) return null
|
||||||
|
|
||||||
const { children, className } = this.props
|
const { children, className } = this.props
|
||||||
let { style } = this.props
|
let { style } = this.props
|
||||||
|
|
||||||
@@ -76,7 +78,6 @@ class Placeholder extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
display: isVisible ? 'block' : 'none',
|
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: '0px',
|
top: '0px',
|
||||||
right: '0px',
|
right: '0px',
|
||||||
|
Reference in New Issue
Block a user