sbrl / Pepperminty-Wiki

A wiki in a box
https://peppermint.mooncarrot.space/
Mozilla Public License 2.0
178 stars 20 forks source link

Feature request: Click on a search suggestion, go to that page. #195

Closed virtadpt closed 4 years ago

virtadpt commented 4 years ago

Right now, if you search on something in the wiki, the search box will turn up a number of possible search hits if there are any in a little drop-down below the search box. If you click on one of them, it populates the search box with the possible search hit. It seems a bit counter-intuitive to search on something that you just found out exists. Maybe make it so that clicking on that auto-suggested search hit will take the user right to that page?

sbrl commented 4 years ago

Great idea! Unfortunately because this is done via a <datalist> element, I don't think that the browser gives me the right event to detect when you select an element from the dropdown list, making this a bit of a challenge to implement.

If you know of such an event that some JS could listen for, then I'm all ears :D

Additionally, it's not currently possible to use the awesomeplete library that's used in the page tags box without some significant refactoring because the Pepperminty Wiki core may not request files to be downloaded as extra data.

virtadpt commented 4 years ago

onchange? https://www.w3schools.com/jsref/event_onchange.asp

onselect? https://www.w3schools.com/jsref/event_onselect.asp

sbrl commented 4 years ago

Unfortunately, those aren't quite right @virtadpt.

virtadpt commented 4 years ago

I guess I've just outed myself as a systems engineer and not a web developer? :)

sbrl commented 4 years ago

Not a problem @virtadpt :P

Since there doesn't appear to be a solution to the problem, I'm going to close this for now. However, if anyone discovers a solution in the future, I will gladly implement it :-)