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

Highlighting hint w shortcuts not work in page embed state #216

Open
JimmyLv opened this issue Apr 27, 2022 · 9 comments
Open

Highlighting hint w shortcuts not work in page embed state #216

JimmyLv opened this issue Apr 27, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@JimmyLv
Copy link

JimmyLv commented Apr 27, 2022

Roam.Research-Roam.Research.-.Page.Embed-001852-20220427.mp4

for example:

#Tag {{[[embed]]: [[Test Hello World!]]}}

In this scenario, w is not in effect and cannot open the embed [[Test Hello World!]] page title

@JimmyLv JimmyLv changed the title Highlighting hint q/w shortcuts not work in page embed state Highlighting hint w shortcuts not work in page embed state Apr 27, 2022
@JimmyLv
Copy link
Author

JimmyLv commented Apr 27, 2022

@Stvad Stvad added the bug Something isn't working label Apr 28, 2022
@Stvad
Copy link
Member

Stvad commented Apr 28, 2022

can confirm/reproduce. it seems to be related to how the html for that case is structured (span inside a), so the hint gets attached to the wrong element

@JimmyLv
Copy link
Author

JimmyLv commented Apr 28, 2022

@Stvad wow, great! Is it easy to fix? I'm also more than happy to help if needed! I would love this fix, 😁

@Stvad
Copy link
Member

Stvad commented Apr 28, 2022

Not sure, I think the fix would be to see if the elements found have sub-element that are links here

export const updateVimHints = (block: HTMLElement) => {
And attach the class to those instead, but I’m not sure if that’d produce the desired behavior reliably. Contributions are welcome!

@JimmyLv
Copy link
Author

JimmyLv commented Apr 30, 2022

ok, but how can I access and click these sub-elements (span inside a)? do you mean the click() method would dispatch the event by the attached classes here?

@JimmyLv
Copy link
Author

JimmyLv commented Apr 30, 2022

Google Chrome-DevTools - roamresearch com-001955-20220430
Does that mean these classes roam-toolkit--hint roam-toolkit--hint1 should be attached to the span element?

JimmyLv added a commit to JimmyLv/roam-toolkit that referenced this issue Apr 30, 2022
@JimmyLv
Copy link
Author

JimmyLv commented Apr 30, 2022

Hey @Stvad , I just created the PR and deployed it to vercel, but it doesn't look like there is a roam/js version? https://roam-toolkit.vercel.app/no_preview_spatial.js

@Stvad
Copy link
Member

Stvad commented May 13, 2022

Apologies, I missed this! roam/js version is built off the separate branch atm (roam-js see #164 )

@JimmyLv
Copy link
Author

JimmyLv commented May 14, 2022

wow, thanks a lot! I just deployed and my PR seems to work well. https://roam-toolkit.vercel.app/entry.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants