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

Allow preventing link insertion in RichContentEditable #3890

Merged

Conversation

julien-nc
Copy link
Contributor

@julien-nc julien-nc commented Mar 15, 2023

When getting a picker result, emit an event so parent components can prevent it to be inserted in the content and add some custom processing.

This could be useful in Talk when getting an OpenStreetMap link. A location rich object could be shared instead of inserting the link.

@julien-nc julien-nc added enhancement New feature or request 2. developing Work in progress feature: rich-contenteditable Related to the rich-contenteditable components feature: richtext Related to the richtext component labels Mar 15, 2023
@julien-nc julien-nc added this to the 7.9.0 milestone Mar 15, 2023
this.updateValue(this.$refs.contenteditable.innerHTML)
const eventData = {
link,
run: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
run: true,
insertText: true,

Might make it a bit clearer what this is about.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@julien-nc julien-nc force-pushed the enh/noid/richcontenteditable-prevent-picker-insertion branch from 102e4db to 4fe5085 Compare March 15, 2023 23:09
@julien-nc julien-nc force-pushed the enh/noid/richcontenteditable-prevent-picker-insertion branch from 4fe5085 to 84d339d Compare March 15, 2023 23:15
@julien-nc julien-nc force-pushed the enh/noid/richcontenteditable-prevent-picker-insertion branch from 84d339d to 8e0783d Compare March 24, 2023 09:26
@julien-nc julien-nc marked this pull request as ready for review March 24, 2023 09:27
Copy link
Contributor

@juliushaertl juliushaertl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested but code looks good

@julien-nc julien-nc modified the milestones: 7.9.0, 7.9.1 Apr 7, 2023
@Pytal Pytal modified the milestones: 7.9.1, 7.11.0 Apr 18, 2023
@artonge artonge modified the milestones: 7.11.0, 7.12.0 May 3, 2023
@nickvergessen nickvergessen modified the milestones: 7.12.0, 8.0.0 May 8, 2023
@susnux susnux requested a review from ShGKme October 19, 2023 13:45
@susnux susnux added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 19, 2023
…pper context prevent text insertion

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@susnux susnux force-pushed the enh/noid/richcontenteditable-prevent-picker-insertion branch from 8e0783d to e4319d3 Compare October 19, 2023 13:45
@nickvergessen nickvergessen requested review from Antreesy and removed request for nickvergessen October 20, 2023 13:16
@nickvergessen nickvergessen removed the request for review from ShGKme October 20, 2023 13:16
Copy link
Contributor

@Antreesy Antreesy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works, tested against Talk

Note for self:

<NcRichContenteditable @smart-picker-submit="handleSmartPickerSubmit" />

handleSmartPickerSubmit(event) {
	console.log(event)
	event.insertText = false
},

@susnux susnux merged commit 3133574 into master Nov 1, 2023
15 checks passed
@susnux susnux deleted the enh/noid/richcontenteditable-prevent-picker-insertion branch November 1, 2023 17:45
@skjnldsv skjnldsv mentioned this pull request Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request feature: rich-contenteditable Related to the rich-contenteditable components feature: richtext Related to the richtext component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants