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

Add support for wrapping images in links #1836

Closed
2 tasks done
nmetulev opened this issue Feb 22, 2018 · 7 comments
Closed
2 tasks done

Add support for wrapping images in links #1836

nmetulev opened this issue Feb 22, 2018 · 7 comments
Labels
controls 🎛️ feature 💡 help wanted Issues identified as good community contribution opportunities parsers 🌱
Milestone

Comments

@nmetulev
Copy link
Contributor

nmetulev commented Feb 22, 2018

I'm submitting a...

  • Feature request (UserVoice request: )

Current behavior

  • An image can not be wrapped in a link - the following is not supported:
    [![image](https://avatars0.githubusercontent.com/u/711864)](https://github.com/nmetulev)
  • Images are not focusable and the cursor does not indicate a clickable area

Expected behavior

  • Support for linked images
  • Images are focusable and cursor changes to a hand on hover

This is supplementing #1091 and #1807

@nmetulev nmetulev added feature 💡 help wanted Issues identified as good community contribution opportunities controls 🎛️ parsers 🌱 labels Feb 22, 2018
@nmetulev nmetulev added this to the 3.0 milestone Feb 22, 2018
@avknaidu
Copy link
Member

avknaidu commented Apr 3, 2018

@nmetulev @WilliamABradley @skendrot

Support for linked images this is completed.

expected

For second Point, The main issue is when the IsTextSelectionEnabled is true on MarkdownTextBlock the cursor always is "Selection". I tried using below solutions.

  1. PointerEntered event by changing IsTextSelectionEnabled to false and then setting Cursor to Hand. ( Does not work )
  2. PointerEntered and PointerExited event by changing IsTextSelectionEnabled to false/true respectively and cursor to Hand/Arrow respectively ( Does not work )
  3. PointerEntered and PointerExited event by not changing IsTextSelectionEnabled and only changing cursor to Hand/Arrow respectively ( Does not work ).

Keep in mind that I did this on whole Renderer itself by checking e.OriginalSource as Image and also on Image itself while rendering it. Either ways, Hand Cursor will just flicker and will be back to the way it was before.

If anyone has any pointers on how this can be handled, it would be very helpful.

@nmetulev
Copy link
Contributor Author

nmetulev commented Apr 4, 2018

This is amazing. If you already have the first one implemented, I'd suggest you submit the PR for that one and lets review it :)

On the second one, curious if our Mouse extension would help here?

@avknaidu
Copy link
Member

avknaidu commented Apr 18, 2018

New PR created for first feature. I have tried using Mouse Extension also but the cursor just flicks and goes away to selector. Happens the same when IsTextSelectionEnabled is false also. If anyone has any ideas, please comment below.

@avknaidu
Copy link
Member

While working on this PR, i noticed that Images can be wrapped into HyperlinkButton Content and then Mouse Pointer will show a Hand instead of a selection. Do you think its a Good idea?

@nmetulev
Copy link
Contributor Author

Interesting, I wonder why we didn't consider that before. Will the image still work as before?

@avknaidu
Copy link
Member

Yes. I can create a branch with the default content and you can check for yourself.

@nmetulev
Copy link
Contributor Author

PR merged

@ghost ghost locked as resolved and limited conversation to collaborators Nov 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
controls 🎛️ feature 💡 help wanted Issues identified as good community contribution opportunities parsers 🌱
Projects
None yet
Development

No branches or pull requests

3 participants