pell icon indicating copy to clipboard operation
pell copied to clipboard

Can't delete custom elements

Open Siccity opened this issue 3 years ago • 3 comments

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.

Siccity avatar Aug 31 '20 14:08 Siccity

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 avatar Jul 07 '21 07:07 xch1029

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

xch1029 avatar Jul 07 '21 07:07 xch1029

Hi, The character for a non-breaking space needs a semi-colon at the end. i.e. &nbsp*;* Ross

On Wed, Jul 7, 2021 at 3:15 PM 小华 @.***> wrote:

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jaredreich/pell/issues/210#issuecomment-875351543, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANWRHLPRZMY24JUEJZEA7KLTWP5K3ANCNFSM4QQS2QEQ .

RossMWoods avatar Jul 07 '21 07:07 RossMWoods