Display more than 100 options in suggester.
Is your feature request related to a problem? Please describe. We have large sets of entities represented as pages. There are several people using this vault and it adds an extra clicks for those who don't necessarily remember the exact entity name they want to select. they have to click off the suggester find the page in the obsidian file navigator and then reopen the suggester and type it in the search field.
Describe the solution you'd like It would be awesome if the suggester could display all of the page names located at the folder directory passed to the optionQuery. instead of the default 100.
Additional context It’s possible this is already easy to fix and i just couldn't find the relevant code in the API. Ive read through the docs and source code for this project and cant spot any relevant code. If this is outside the scope of this plugin no worries at all. I wouldn’t mind a nudge in the right direction if anyone has a suggestion.
I am using obsidians built-in search modal. So there is nothing i can do about that except rebuilding it from scratch, but that is not a thing i want to do.
Yeah that would be a pain. thanks for your excellent work!
For anyone wanting a work around to this same problem you can do a search in the main.js file in the plugin folder
search for "AF.FuzzySuggestModal{constructor(t,n,i){super(t);this.options=n,this.onSelect=i}" and replace it with "AF.FuzzySuggestModal{constructor(t,n,i){super(t);this.options=n,this.onSelect=i,this.limit=200}"
you can just add this.limit=200 to the end. and set the value to what ever you want. It should be pretty simple to add this to the class constructor at ".\obsidian-meta-bind-plugin-0.7.0\src\inputFields\fields\Suggester\SuggesterInputModal.ts" before building. I say should be simple because I personally couldn't get my build to work. theoretically though one should be able to replace the code with this.
import { type App, FuzzySuggestModal } from 'obsidian';
import { type SuggesterOption } from './SuggesterHelper';
import { type MBLiteral } from '../../../utils/Utils';
export class SuggesterInputModal extends FuzzySuggestModal<SuggesterOption<MBLiteral>> {
options: SuggesterOption<MBLiteral>[];
onSelect: (item: SuggesterOption<MBLiteral>) => void;
constructor(app: App, options: SuggesterOption<MBLiteral>[], onSelect: (item: SuggesterOption<MBLiteral>) => void) {
super(app);
this.options = options;
this.onSelect = onSelect;
this.limit = 200;
}
public getItemText(item: SuggesterOption<MBLiteral>): string {
return item.displayValue;
}
public getItems(): SuggesterOption<MBLiteral>[] {
return this.options;
}
public onChooseItem(item: SuggesterOption<MBLiteral>, _: MouseEvent | KeyboardEvent): void {
this.onSelect(item);
}
}
This should work as FuzzySuggestModal extends and inherits from SuggestModal which has the public property 'limit'.
@OnodOfTheNorth apologies for the necro, but did you by any chance happen to figure out getting it working to manually implement it showing more options?