Clicking outside a contenteditable div stills give focus to it?

后端 未结 5 1246
独厮守ぢ
独厮守ぢ 2020-12-14 15:52

For some reason I need to use contenteditable div instead of normal text input for inputting text. (for some javascript library) It works fine until I found that when I set

5条回答
  •  悲哀的现实
    2020-12-14 16:22

    Disable text selection in container... should fix that.

    For example:

    * {
       -ms-user-select: none; /* IE 10+ */
       -moz-user-select: -moz-none;
       -khtml-user-select: none;
       -webkit-user-select: none;
       user-select: none;
    }
    

提交回复
热议问题