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

Can't delete custom elements #210

Open
Siccity opened this issue Aug 31, 2020 · 3 comments
Open

Can't delete custom elements #210

Siccity opened this issue Aug 31, 2020 · 3 comments

Comments

@Siccity
Copy link

Siccity commented Aug 31, 2020

Hey, new user here. Loving pell so far!

I added some custom actions for video and others like this:

actions: [
 	...
	'image',
	{
		name: 'video',
		icon: '📹',
		title: 'Video',
		result: () => {
			const url = window.prompt('Enter the video URL')
			if (url) pell.exec('insertHTML', `<video src="` + url + `" width="400" controls>` + 
			'Your browser does not support HTML5 video.' +
			'</video>')
		}
	},
	...
]

Inserting a video link works perfectly. But if you insert it as the last thing in the input field, you can no longer remove it, or get the cursor to the other side of it anymore. Not even pressing the Delete button can delete it.

@xch1029
Copy link

xch1029 commented Jul 7, 2021

the reason is that these is none text to interact with. try add &nbsp befor and after of video tag, like this:

result: () => {
	const url = window.prompt('Enter the video URL')
	if (url) pell.exec('insertHTML', `&nbsp<video src="` + url + `" width="400" controls>` + 
	'Your browser does not support HTML5 video.' +
	'</video>&nbsp')
}

@xch1029
Copy link

xch1029 commented Jul 7, 2021

and if you want to delete this video, you should select video and it's before and after whitespace. It's a litter unfriendly. For now, I'm looking for a better way to deal video

@RossMWoods
Copy link

RossMWoods commented Jul 7, 2021 via email

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