File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 730
730
setTimeout (() => {
731
731
setTimeout (() => {
732
732
// for example when clicking on the empty area in the main menu
733
- if (! hasFocus && ! isChildOfNodeName (event .target as Element , ' BUTTON' )) {
733
+ if (( ! hasFocus && ! isChildOfNodeName (event .target , ' BUTTON' )) || event . target . nodeName === ' DIV ' ) {
734
734
focus ()
735
735
}
736
736
})
1708
1708
class:no-main-menu ={! mainMenuBar }
1709
1709
on:mousedown ={handleMouseDown }
1710
1710
on:keydown ={handleKeyDown }
1711
- on:paste ={handlePaste }
1712
1711
on:contextmenu ={handleContextMenu }
1713
1712
bind:this ={refJsonEditor }
1714
1713
>
1730
1729
<label class =" jse-hidden-input-label" >
1731
1730
<input
1732
1731
type =" text"
1733
- readonly =" readonly "
1732
+ readonly ={ true }
1734
1733
tabindex =" -1"
1735
1734
class =" jse-hidden-input"
1736
1735
bind:this ={refHiddenInput }
1736
+ on:paste ={handlePaste }
1737
1737
/>
1738
1738
</label >
1739
1739
{#if containsValidArray }
Original file line number Diff line number Diff line change 1820
1820
// TODO: ugly to have two setTimeout here. Without it, hiddenInput will blur
1821
1821
setTimeout (() => {
1822
1822
setTimeout (() => {
1823
- if (! hasFocus && ! isChildOfNodeName (event .target , ' BUTTON' )) {
1823
+ if (( ! hasFocus && ! isChildOfNodeName (event .target , ' BUTTON' )) || event . target . nodeName === ' DIV ' ) {
1824
1824
// for example when clicking on the empty area in the main menu
1825
1825
focus ()
1826
1826
2106
2106
class:no-main-menu ={! mainMenuBar }
2107
2107
on:keydown ={handleKeyDown }
2108
2108
on:mousedown ={handleMouseDown }
2109
- on:paste ={handlePaste }
2110
2109
on:contextmenu ={handleContextMenu }
2111
2110
bind:this ={refJsonEditor }
2112
2111
>
2147
2146
tabindex =" -1"
2148
2147
class =" jse-hidden-input"
2149
2148
bind:this ={refHiddenInput }
2149
+ on:paste ={handlePaste }
2150
2150
/>
2151
2151
</label >
2152
2152
{#if json === undefined }
You can’t perform that action at this time.
0 commit comments