obsidian-workspaces-plus icon indicating copy to clipboard operation
obsidian-workspaces-plus copied to clipboard

Open Workspaces Plus: Insider Builds 0.16.5 and 1.0.0

Open michaelpporter opened this issue 2 years ago • 12 comments

Describe the bug Started in 0.16.5: "Open Workspaces Plus" gets a JS eror

To Reproduce Steps to reproduce the behavior:

  1. Go to install the 0.16.5 version of insider builds
  2. Click on Any method to "Open Workspaces Plus" option-esc, command pallet
  3. See nothing, unless you have Developer Tools open
Uncaught DOMException: Failed to execute 'replaceChild' on 'Node': The node to be replaced is not a child of this node.
    at new WorkspacesPlusPluginModal (plugin:workspaces-plus:2106:22)
    at WorkspacesPlus.onStatusBarClick (plugin:workspaces-plus:2445:9)
    at HTMLDivElement.eval (plugin:workspaces-plus:2433:61)
WorkspacesPlusPluginModal @ plugin:workspaces-plus:2106
onStatusBarClick @ plugin:workspaces-plus:2445
eval @ plugin:workspaces-plus:2433

Expected behavior Opening the swicher

Screenshots N/A

Desktop (please complete the following information):

  • OS: macOS Monterey
  • Browser Obsidian 0.16.5
  • Version 12.6.1

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

michaelpporter avatar Oct 07 '22 13:10 michaelpporter

Same on 1.0

tprotopopescu avatar Oct 13 '22 18:10 tprotopopescu

Also reported as #87

michaelpporter avatar Oct 17 '22 18:10 michaelpporter

I found an easy fix, while we wait for @nothingislost to handle this properly:

  • Navigate to <vault>/.obsidian/plugins/workspaces-plus/ and open main.js
  • find the following lines:
        // clone the input element as a hacky way to get rid of the obsidian onInput handler
        const inputElClone = this.inputEl.cloneNode();
        this.modalEl.replaceChild(inputElClone, this.inputEl);
        this.inputEl = inputElClone;
  • comment them out.
  • If using the beta version, the offensive lines appear twice! Comment them out twice!

I could not notice any issues with onInput handler - on the other hand, my Workspaces-Plus modal now shows up again 🎉

EDIT: to comment them out, add // in front of the line:

        // clone the input element as a hacky way to get rid of the obsidian onInput handler
        //const inputElClone = this.inputEl.cloneNode();
        //this.modalEl.replaceChild(inputElClone, this.inputEl);
        //this.inputEl = inputElClone;

etiennepellegrini avatar Oct 25 '22 02:10 etiennepellegrini

Thank you! Thank you!

tprotopopescu avatar Oct 25 '22 11:10 tprotopopescu

It works perfectly!! thank you so much!

gavinwoo007 avatar Oct 27 '22 06:10 gavinwoo007

Thank you very much!!

mmdzt avatar Oct 27 '22 14:10 mmdzt

Thanks for posting your solution.

ronrdev avatar Oct 29 '22 18:10 ronrdev

I found an easy fix, while we wait for @nothingislost to handle this properly:

  • Navigate to <vault>/.obsidian/plugins/workspaces-plus/ and open main.js
  • find the following lines:
  • comment them out.

It's work. Very thankful.

jerviscui avatar Oct 30 '22 07:10 jerviscui

@etiennepellegrini Thank you so much. It works.

mufftin avatar Oct 30 '22 12:10 mufftin

Thanks , it works

DTIM001 avatar Nov 04 '22 00:11 DTIM001

Thanks for posting your solution.

DreamEye-nnn avatar Nov 30 '22 09:11 DreamEye-nnn

@aropele thank you again for posting the fix. everyone, please see #93

hopefully the plugin is working again for you all 🤞

jsmorabito avatar Dec 11 '22 21:12 jsmorabito