Unable to delete a video using backspace on some devices
Update: With recent video fixes, the issue now only applies to the HTC One (M8) (5.1.0), and only to backspacing videos at the start of posts.
Original issue:
Deleting a video using the backspace key on a virtual keyboard doesn't work on XPeria Z5 (5.1.1) or the HTC One (M8) (5.1.0).
Unable to reproduce on emulators running 4.2.2, 5.0, 5.1.0.
Original ref: https://github.com/wordpress-mobile/WordPress-Android/pull/3782#issuecomment-188350641
Tested on my XPeria Z5 (now 6.0), and I was able to delete the video. Maybe it was fixed by the p2div branch?
@tonyr59h: could you give this another try on your HTC One? If it's not reproducible there either we can probably close this.
Local video uploads-in-progress delete as expected with the virtual keyboard backspace.
Videos that have finished uploading and videos added from the WordPress media library delete as expected _unless_ the video element is the first element in the post.
For example, backspacing the video works for:
This is a post
[video code]
...
but does not work for:
[video code]
...
Behaves as expected on the 5X minus some cursor positioning hiccups.
I can repro what Tony's describing on the z5 Android 6.0: When a post starts with [wpvideo code] it can't be deleted in visual mode with the delete key.
Debug HTML, with this test case:
<div contenteditable="true" id="zss_field_content" class="field" placeholdertext="Partagez ici votre histoire..." style="min-height: 383px;"><div><br></div><div><video webkit-playsinline="" src="https://taliwutblog.files.wordpress.com/2016/04/wp-1461675661880.mp4" onclick="" controls="controls" preload="metadata" poster="https://taliwutblog.files.wordpress.com/2016/04/wp-1461675661880_std.original.jpg" data-wpvideopress="hmbzwjhI"></video></div></div>
From the debug HTML it looks like the <div><br></div> that's supposed to be inserted right after the video is instead being added above it on those devices. Maybe the cursor is being reset somehow, so that this line doesn't add the new paragraph where it's supposed to.
@tonyr59h mentioned seeing some cursor hiccups on the 5X - I wasn't able to reproduce that, but that suggests that the paragraph placement issue on the Z5/HTC One really is caused by cursor weirdness.
Until we find out more, implementing https://github.com/wordpress-mobile/WordPress-Editor-Android/issues/377 will at least make it possible to delete videos without resorting to HTML mode.
cc @tonyr59h to take videos for a spin on the HTC One with the latest editor, everything should be smooth by now 😀
@aforcier My HTC One is still unable to delete uploaded videos at the beginning of a post. Everything else is working well and I'm not noticing any odd cursor behavior 😄
I also tested with other devices and emulators, they're working great 👍
Thanks @tonyr59h! If that's the only outstanding bug I think we can drop this issue from the 1.3 milestone (but keep it open for tracking), since we can delete videos by tapping the X button now.