Skip to content

Open Workspaces Plus command focus and match bugs (with my fix) #114

Description

@kriss-spy

Describe the bug
in obsidian 1.8.10 (installed through AppImage)
run Open Workspaces Plus command
focus not on search box (still at note editor?)
if I click on search box to focus, no workspace match for typed string

To Reproduce
Steps to reproduce the behavior:

  1. run Open Workspaces Plus command
  2. try type anything
  3. click on search box
  4. type workspace name to match

Expected behavior
should focus on search box after command run
should has a real time match for workspace, so I can hit enter and open that workspace

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [manjaro]

Additional context
here is my fix, I directly edited the main.js

the final step is deleting three lines of code:

const inputElClone = this.inputEl.cloneNode();
// this.modalEl.replaceChild(inputElClone, this.inputEl);
this.inputEl = inputElClone;

all changes:

❯ diff workspaces-plus/main.js workspaces-plus-fixed/main.js                                                                                                                            ─╯
14,36c14,36
< /******************************************************************************
< Copyright (c) Microsoft Corporation.
< 
< Permission to use, copy, modify, and/or distribute this software for any
< purpose with or without fee is hereby granted.
< 
< THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
< REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
< AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
< INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
< LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
< OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
< PERFORMANCE OF THIS SOFTWARE.
< ***************************************************************************** */
< 
< function __awaiter(thisArg, _arguments, P, generator) {
<     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
<     return new (P || (P = Promise))(function (resolve, reject) {
<         function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
<         function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
<         function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
<         step((generator = generator.apply(thisArg, _arguments || [])).next());
<     });
---
> /******************************************************************************
> Copyright (c) Microsoft Corporation.
> 
> Permission to use, copy, modify, and/or distribute this software for any
> purpose with or without fee is hereby granted.
> 
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
> AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
> OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
> PERFORMANCE OF THIS SOFTWARE.
> ***************************************************************************** */
> 
> function __awaiter(thisArg, _arguments, P, generator) {
>     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
>     return new (P || (P = Promise))(function (resolve, reject) {
>         function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
>         function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
>         function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
>         step((generator = generator.apply(thisArg, _arguments || [])).next());
>     });
2550,2552d2549
<         const inputElClone = this.inputEl.cloneNode();
<         // this.modalEl.replaceChild(inputElClone, this.inputEl);
<         this.inputEl = inputElClone;
2903,2906d2899
<         // 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;
4630c4623
< /* nosourcemap */
\ No newline at end of file
---
> /* nosourcemap */

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions