microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.38k stars 28.62k forks source link

dragenter not trigger #224821

Open watsonnnnn opened 1 month ago

watsonnnnn commented 1 month ago

Type: Bug

  1. add sidebarprovider and set content by copy https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/drag_event demo play code
  2. dragenter not trigger

VS Code version: Code 1.92.0 OS version: Darwin arm64 23.5.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M1 Pro (8 x 2400)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|2, 2, 3| |Memory (System)|16.00GB (0.20GB free)| |Process Argv|--crash-reporter-id 39ea68bc-1cd1-4914-9fd8-733481886f67| |Screen Reader|no| |VM|0%|
Extensions (75) Extension|Author (truncated)|Version ---|---|--- vscode-django|bat|1.15.0 simple-react-snippets|bur|1.2.8 turbo-console-log|Cha|2.10.4 npm-intellisense|chr|1.4.5 path-intellisense|chr|2.9.0 vue-peek|dar|1.0.2 vscode-eslint|dba|3.0.10 githistory|don|0.6.20 python-environment-manager|don|1.2.4 python-extension-pack|don|1.7.0 es7-react-js-snippets|dsz|4.4.3 gitlens|eam|15.2.3 vscode-html-css|ecm|2.0.10 prettier-vscode|esb|10.4.0 auto-close-tag|for|0.5.15 auto-rename-tag|for|0.1.10 code-runner|for|0.12.2 leek-fund|gis|3.9.2 copilot|Git|1.219.0 copilot-chat|Git|0.18.1 vscode-mocha-test-adapter|hbe|2.14.1 vscode-test-explorer|hbe|2.21.1 vue-snippets|hol|1.0.4 vscode-graphviz|joa|0.0.6 vscode-peacock|joh|4.2.2 vsc-python-indent|Kev|1.18.0 MagicPython|mag|1.1.0 vscode-scss|mrm|0.10.0 vscode-language-pack-zh-hans|MS-|1.92.2024073109 autopep8|ms-|2024.0.0 debugpy|ms-|2024.8.0 python|ms-|2024.12.1 vscode-pylance|ms-|2024.7.1 jupyter|ms-|2024.5.0 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.19 vscode-jupyter-cell-tags|ms-|0.1.9 vscode-jupyter-slideshow|ms-|0.1.6 extension-test-runner|ms-|0.0.11 test-adapter-converter|ms-|0.1.9 vscode-react-native|msj|1.13.0 color-highlight|nau|2.8.0 autodocstring|njp|0.6.1 vetur|oct|0.37.3 vscode-jest|Ort|6.2.5 vscode-css-peek|pra|4.4.1 java|red|1.33.0 vs-code-prettier-eslint|rve|6.0.0 vue-vscode-snippets|sdr|3.1.1 markdown-preview-enhanced|shd|0.8.13 autoimport|ste|1.5.4 code-spell-checker|str|3.0.1 sass-indented|syl|1.8.30 language-stylus|sys|1.16.0 open-in-browser|tec|2.0.0 stylus-supremacy|thi|2.17.7 graphviz-interactive-preview|tin|0.3.5 vscode-status-bar-format-toggle|tom|3.2.0 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.3.1 vscode-java-debug|vsc|0.58.0 vscode-java-dependency|vsc|0.24.0 vscode-java-pack|vsc|0.28.0 vscode-java-test|vsc|0.42.0 vscode-maven|vsc|0.44.0 vscode-icons|vsc|12.8.0 volar|Vue|2.0.28 vscode-typescript-vue-plugin|Vue|1.8.27 vscode-todo-highlight|way|1.0.5 jinja|who|0.0.8 vscode-import-cost|wix|3.3.0 JavaScriptSnippets|xab|1.8.0 five-server|yan|0.3.1 markdown-all-in-one|yzh|3.6.2 html-css-class-completion|Zig|1.20.0 (3 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 bdiig495:31013172 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 impr_priority:31102340 refactort:31108082 ccplt:31103426 pythonrstrctxtcf:31103194 wkspc-onlycs-c:31106320 ```
justschen commented 1 month ago

/needsMoreInfo

I don't believe this is a vs code issue, could you provide more details?

vs-code-engineering[bot] commented 1 month ago

Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.

Happy Coding!

watsonnnnn commented 1 month ago

Ok. I just create one WebviewViewProvider,and then set webview html entire page content with the above link's code. It's worked as well on last week,when my vscode updates automatically to 1.92 it does not work as usual. After that, I download 1.90 and 1.91 from the website it can work as usual.

watsonnnnn commented 1 month ago
//extension.ts
 const sidebarPanelProvider = new SidebarProvider(context)
    context.subscriptions.push(
      vscode.window.registerWebviewViewProvider(item, sidebarPanelProvider, {
        webviewOptions: {
          retainContextWhenHidden: true,
        },
      })
    )

//SidebarProvider.ts
import * as vscode from 'vscode'

export class SidebarProvider implements vscode.WebviewViewProvider {
  constructor(private readonly context: vscode.ExtensionContext) {}

  public async resolveWebviewView(webviewView: vscode.WebviewView) {
    webviewView.webview.options = {
      enableScripts: true,
    }
    webviewView.webview.html = await this._getHtmlForWebview(
      webviewView.webview,
      this.context
    )
  }

  private async _getHtmlForWebview(
    webview: vscode.Webview,
    context: vscode.ExtensionContext
  ) {
    const resourcePath = vscode.Uri.joinPath(
      context.extensionUri,
      './webdist/index.html'
    )
    let html: string = await require('fs').readFileSync(resourcePath, 'utf-8')
    return html
  }
}

//index.html


  
    
    
    
    test
    
  
  
    
This div is draggable