File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1163,8 +1163,10 @@ export class NumSlider extends Widget {
11631163
11641164 this . addLabel ( ) ;
11651165
1166+ let touchstart_time = 0 ;
11661167 this . jq_inner
11671168 . on ( 'mousedown touchstart' , async ( event ) => {
1169+ touchstart_time = Date . now ( ) ;
11681170 if ( scope . jq_inner . hasClass ( 'editing' ) ) return ;
11691171 scope . last_value = scope . value ;
11701172
@@ -1254,7 +1256,11 @@ export class NumSlider extends Widget {
12541256 scope . stopInput ( )
12551257
12561258 } )
1257- . on ( 'contextmenu' , ( event : Event ) => {
1259+ . on ( 'contextmenu' , ( event : PointerEvent & any ) => {
1260+ if ( Blockbench . isTouch && event . button != 3 ) {
1261+ let press_time = Date . now ( ) - touchstart_time ;
1262+ if ( press_time < 400 ) return ;
1263+ }
12581264 new Menu ( [
12591265 new MenuSeparator ( 'copypaste' ) ,
12601266 {
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ onVueSetup(function() {
2424 } ,
2525 methods : {
2626 showContextMenu ( event : MouseEvent ) {
27+ if ( ( event . target as HTMLElement ) . closest ( '.toolbar' ) ) return ;
2728 Interface . status_bar . menu . show ( event ) ;
2829 } ,
2930 toggleStreamerMode ( ) {
You can’t perform that action at this time.
0 commit comments