display a overlay when input is clicked in react

前端 未结 2 1496
[愿得一人]
[愿得一人] 2020-12-31 21:37

I\'m trying to display a overlay when a certain Input field is clicked. I\'m doing this in react. How can I do this?

This is my code



        
2条回答
  •  孤城傲影
    2020-12-31 21:58

    Input:

     this.setState({show_overlay: true})} />
    

    somewhere arround in same render() function add overlay div:

    overlay

    of course add styling to div as needed to have proper overlay effect, what's needed by your UI

    To turn overlay off, you will need to add another event listener on some action, like e.g. click

    
    

提交回复
热议问题