Skip to content
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

Making result (pagefind-ui__result) clickable instead of title #606

Open
alexanderameye opened this issue Apr 26, 2024 · 5 comments
Open

Comments

@alexanderameye
Copy link

Right now, the element with class pagefind-ui__result-link is the one that is actually clickable. How is it possible to make the whole result clickable? (The li element with the class pagefind-ui__result )

@flyfoto
Copy link

flyfoto commented Apr 26, 2024

Especially the optional image left to a result is expected by most userers to be a clickable link to the hit. see #235 posted long ago

@alexanderameye
Copy link
Author

Is there any workaround possible?

@nhoizey
Copy link
Contributor

nhoizey commented May 15, 2024

I think it should be possible with these styles:

.pagefind-ui__result {
  position: relative;
}

.pagefind-ui__result-link::after {
  position: absolute;
  inset: 0;
  content: "";
}

You can try it here (where I don't use the default CSS):

https://nicolas-hoizey.photo/search/?q=try

@alexanderameye
Copy link
Author

.pagefind-ui__result {
  position: relative;
}

.pagefind-ui__result-link::after {
  position: absolute;
  inset: 0;
  content: "";
}

That worked well thanks! A more modular/minimal UI solution that you have more control over yourself would be a nice photo addition, but this will most definitely do for now. Thanks a lot :)

@nhoizey
Copy link
Contributor

nhoizey commented May 17, 2024

@alexanderameye you're welcome, happy it worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants