Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview Widget doesn't render preview for empty documents #8728

Closed
sdirix opened this issue Nov 6, 2020 · 0 comments · Fixed by #8729
Closed

Preview Widget doesn't render preview for empty documents #8728

sdirix opened this issue Nov 6, 2020 · 0 comments · Fixed by #8729
Labels
bug bugs found in the application preview issues related to the preview

Comments

@sdirix
Copy link
Member

sdirix commented Nov 6, 2020

Bug Description:

Preview Widget doesn't render preview for empty documents

Steps to Reproduce:

  1. Implement a new PreviewHandler which renders content for empty documents
  2. Open preview on empty document
  3. The preview is empty although it should render the content mentioned above

I assume this was not noticed until now as the Markdown preview is empty anyway for empty documents.

Additional information

Code

@injectable()
class MyPreviewHandler implements PreviewHandler {
  canHandle(uri: URI) {
    return 1000;
  }
  renderContent() {
    const div = document.createElement("div");
    div.innerText = "my preview";
    return div;
  }
}

Error Case

Error_Case_Screenshot

Expected Behavior

Expected_Behavior_Screenshot

@vince-fugnitto vince-fugnitto added bug bugs found in the application preview issues related to the preview labels Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application preview issues related to the preview
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants