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

[Bugfix] Instantiate Link with inclusive set to false #1727

Merged
merged 1 commit into from
Mar 10, 2024

Conversation

CorreyL
Copy link
Contributor

@CorreyL CorreyL commented Jan 21, 2024

If the maintainers of Reactive Resume agree with the points raised in my issue here:

#1726

This PR will configure Tiptap to behave similar to other text editors when adding hyperlinks.

Before

reactive-resume

After

reactive-resume-change


⚠️Possible Undesired Side Effect

I will note that this may negatively impact users who wish to add text after adding a hyperlink to the editor:

Before

link-after-text before

After

link-after-text after

And as such, I will understand if the Reactive Resume maintainers see this as an overall negative change.

Ensures consistent behavior with other common text editors, wherein
after applying a link to text, the following text does not also contain
the link
@CorreyL
Copy link
Contributor Author

CorreyL commented Jan 21, 2024

To avoid the undesired side effect mentioned above, perhaps I could extend this implementation to instantiate a new component?

Rather than the simple window.prompt here:

const Toolbar = ({ editor }: { editor: Editor }) => {
const setLink = useCallback(() => {
const previousUrl = editor.getAttributes("link").href;
const url = window.prompt("URL", previousUrl);

I could implement a new modal similar to other text editors, where there is a second input element that allows for the intended text to be added as well:

Microsoft Word

image

Google Docs

image

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

Successfully merging this pull request may close these issues.

2 participants