-
Notifications
You must be signed in to change notification settings - Fork 197
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
Bug: FuzzySuggestModal's onChooseItem
does not fire on enter/return with modifier keys
#85
Comments
I've reproduced the issue in a sample plugin here: https://github.com/cryy22/obsidian-FuzzySuggestModal-bug-demo |
onChooseItem
does not fire when modifier keys are held downonChooseItem
does not fire on enter/return with modifier keys
This is currently on purpose but the procedure to allow other keys is not yet well documented: constructor(app: App) {
super(app);
// @ts-ignore
this.scope.register([], 'Tab', (evt: KeyboardEvent) => {
// @ts-ignore
if (!evt.isComposing && this.suggestions.useSelectedItem(evt)) {
return false;
}
});
} |
Zachatoo
added a commit
to Zachatoo/obsidian-css-editor
that referenced
this issue
Sep 3, 2023
Found solution in obsidianmd/obsidian-api#85 #14
Looks like the internal APIs changed a bit, here's the solution that worked for me. Would love to see better support for this. constructor(app: App) {
super(app);
this.scope.register([], 'Tab', (evt: KeyboardEvent) => {
// @ts-ignore
if (!evt.isComposing && this.chooser.useSelectedItem(evt)) {
return false;
}
});
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to open a file selected via
FuzzySuggestModal
in a new tab, new split, or new window according to the modifier keys held down while the selection occurs, mirroring the behavior of Quick Switcher. However,onChooseItem
is not currently firing when any modifier keys are held down.Steps to reproduce:
FuzzySuggestModal
and implementgetItems
andgetItemText
with dummy dataonChooseItem
,console.log("hello")
FuzzySuggestModal
from ObsidianThe text was updated successfully, but these errors were encountered: