Markdown preview rendered for outdated markdown on android #8986

Closed
opened 2025-11-02 08:24:52 -06:00 by GiteaMirror · 13 comments
Owner

Originally created by @joschahenningsen on GitHub (May 22, 2022).

Description

When editing markdown (issue and pull request comments), clicking the preview button on mobile devices when the text input still has focus doesn't render the latest markdown but markdown that misses the latest input instead.

tested on Chrome for Android 11

Gitea Version

1.17.0+dev-610-gfa5dec966

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

https://user-images.githubusercontent.com/44805696/169714463-6d957466-d90c-469a-a1fc-26298dda76be.mp4

Git Version

No response

Operating System

No response

How are you running Gitea?

Tested this locally and on https://try.gitea.io

Database

SQLite

Originally created by @joschahenningsen on GitHub (May 22, 2022). ### Description When editing markdown (issue and pull request comments), clicking the preview button on mobile devices when the text input still has focus doesn't render the latest markdown but markdown that misses the latest input instead. <small>tested on Chrome for Android 11</small> ### Gitea Version 1.17.0+dev-610-gfa5dec966 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots https://user-images.githubusercontent.com/44805696/169714463-6d957466-d90c-469a-a1fc-26298dda76be.mp4 ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Tested this locally and on https://try.gitea.io ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 08:24:52 -06:00
Author
Owner

@yp05327 commented on GitHub (Feb 24, 2023):

You inputted the characters without confirming them, so they were just Preview Characters in the inputbox.
Then you switched to Preview, of course, the characters in the inpubox weren't changed at that moment.
Then you switched to Write, maybe a feature of your IME? IME automatically 'confirmed' the changes.
Then you switched to Preview, of course, the characters in the inputbox were changed.

Github uses textarea which has no problem, but gitea uses CodeMirror here. Maybe you need to fix this in CodeMirror.

@yp05327 commented on GitHub (Feb 24, 2023): You inputted the characters without confirming them, so they were just Preview Characters in the inputbox. Then you switched to `Preview`, of course, the characters in the inpubox weren't changed at that moment. Then you switched to `Write`, maybe a feature of your IME? IME automatically 'confirmed' the changes. Then you switched to `Preview`, of course, the characters in the inputbox were changed. Github uses `textarea` which has no problem, but gitea uses CodeMirror here. Maybe you need to fix this in CodeMirror.
Author
Owner

@wxiaoguang commented on GitHub (Feb 24, 2023):

Gitea 1.18 and newer are using the CodeMirror with contenteditable mode, which brings different editing experience.

Please try if the problem gets better in new releases.

@wxiaoguang commented on GitHub (Feb 24, 2023): Gitea 1.18 and newer are using the CodeMirror with contenteditable mode, which brings different editing experience. * #19776 Please try if the problem gets better in new releases.
Author
Owner

@yp05327 commented on GitHub (Feb 24, 2023):

I tested by using Japanese Google IME in 1.18.5 (I only have this which may cause the same problem I think), and it was same.
But Github has no problem.

@yp05327 commented on GitHub (Feb 24, 2023): I tested by using Japanese Google IME in 1.18.5 (I only have this which may cause the same problem I think), and it was same. But Github has no problem.
Author
Owner

@wxiaoguang commented on GitHub (Feb 24, 2023):

Yup, the problem is contenteditable, sometimes it doesn't work well, and that's the reason why there were discussions about dropping EasyMDE&CodeMirror ....

@wxiaoguang commented on GitHub (Feb 24, 2023): Yup, the problem is `contenteditable`, sometimes it doesn't work well, and that's the reason why there were discussions about dropping EasyMDE&CodeMirror ....
Author
Owner

@lunny commented on GitHub (Apr 3, 2023):

Should be fixed by #23876 ?

@lunny commented on GitHub (Apr 3, 2023): Should be fixed by #23876 ?
Author
Owner

@yp05327 commented on GitHub (Apr 6, 2023):

Tested in 1.20.0-361, Preview displayed the characters, but the inputbox was empty.

@yp05327 commented on GitHub (Apr 6, 2023): Tested in 1.20.0-361, Preview displayed the characters, but the inputbox was empty.
Author
Owner

@wxiaoguang commented on GitHub (Apr 6, 2023):

Tested in 1.20.0-361, Preview displayed the characters, but the inputbox was empty.

Can you elaborate, or provide some screenshots?

@wxiaoguang commented on GitHub (Apr 6, 2023): > Tested in 1.20.0-361, Preview displayed the characters, but the inputbox was empty. Can you elaborate, or provide some screenshots?
Author
Owner

@joschahenningsen commented on GitHub (Apr 6, 2023):

Should be fixed by #23876 ?

Yup, seems to be working now 👍

@joschahenningsen commented on GitHub (Apr 6, 2023): > Should be fixed by #23876 ? Yup, seems to be working now 👍
Author
Owner

@yp05327 commented on GitHub (Apr 6, 2023):

Tested in 1.20.0-361, Preview displayed the characters, but the inputbox was empty.

Can you elaborate, or provide some screenshots?

I can’t upload videos to github on my phone.

Preview is worked.
CF10BBA0-7C16-412E-8D1C-E7541D6D06A9
But the input box is empty.
5C520939-4273-48B0-9540-DFF416BBF8D7

Github have the same behavior, so maybe it is all right.

@yp05327 commented on GitHub (Apr 6, 2023): > > Tested in 1.20.0-361, Preview displayed the characters, but the inputbox was empty. > > Can you elaborate, or provide some screenshots? I can’t upload videos to github on my phone. Preview is worked. ![CF10BBA0-7C16-412E-8D1C-E7541D6D06A9](https://user-images.githubusercontent.com/18380374/230342013-c48fad0e-f356-4cb1-910a-25b647bc68a8.png) But the input box is empty. ![5C520939-4273-48B0-9540-DFF416BBF8D7](https://user-images.githubusercontent.com/18380374/230342045-9a240ce5-208e-4c8c-9ed8-679ce705b482.png) Github have the same behavior, so maybe it is all right.
Author
Owner

@wxiaoguang commented on GitHub (Apr 6, 2023):

I can’t upload videos to github on my phone.
Preview is worked.
But the input box is empty.
Github have the same behavior, so maybe it is all right.

What's the steps? Do you mean that:

  1. Open the New Issue page
  2. Input something into the textarea
  3. Click the Preview
  4. Preview shows
  5. Click Write
  6. The textarea loses its content and becomes empty?
@wxiaoguang commented on GitHub (Apr 6, 2023): > I can’t upload videos to github on my phone. > Preview is worked. > But the input box is empty. > Github have the same behavior, so maybe it is all right. What's the steps? Do you mean that: 1. Open the New Issue page 2. Input something into the textarea 3. Click the Preview 4. Preview shows 5. Click Write 6. The textarea loses its content and becomes empty?
Author
Owner

@yp05327 commented on GitHub (Apr 6, 2023):

image
I know the reason now LOL

Here is the video:

https://user-images.githubusercontent.com/18380374/230401807-606b59b0-7081-4dab-99dc-88ef79274042.mp4

@yp05327 commented on GitHub (Apr 6, 2023): ![image](https://user-images.githubusercontent.com/18380374/230398979-82ba70fc-ac7f-443c-89cb-e74465855468.png) I know the reason now LOL Here is the video: https://user-images.githubusercontent.com/18380374/230401807-606b59b0-7081-4dab-99dc-88ef79274042.mp4
Author
Owner

@joschahenningsen commented on GitHub (Apr 6, 2023):

This should probably be discussed in a separate issue.

Am Do., 6. Apr. 2023 um 16:05 Uhr schrieb yp05327 @.***

:

[image: image]
https://user-images.githubusercontent.com/18380374/230398979-82ba70fc-ac7f-443c-89cb-e74465855468.png
I know the reason now LOL

Here is the video:

https://user-images.githubusercontent.com/18380374/230401807-606b59b0-7081-4dab-99dc-88ef79274042.mp4


Reply to this email directly, view it on GitHub
https://github.com/go-gitea/gitea/issues/19784#issuecomment-1499118434,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AKV24QCK4YSLAW7UAQOFYRLW73EQ3ANCNFSM5WT4FDKA
.
You are receiving this because you modified the open/close state.Message
ID: @.***>

--
Joscha Henningsen
He/Him

@joschahenningsen commented on GitHub (Apr 6, 2023): This should probably be discussed in a separate issue. Am Do., 6. Apr. 2023 um 16:05 Uhr schrieb yp05327 ***@***.*** >: > [image: image] > <https://user-images.githubusercontent.com/18380374/230398979-82ba70fc-ac7f-443c-89cb-e74465855468.png> > I know the reason now LOL > > Here is the video: > > > https://user-images.githubusercontent.com/18380374/230401807-606b59b0-7081-4dab-99dc-88ef79274042.mp4 > > — > Reply to this email directly, view it on GitHub > <https://github.com/go-gitea/gitea/issues/19784#issuecomment-1499118434>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AKV24QCK4YSLAW7UAQOFYRLW73EQ3ANCNFSM5WT4FDKA> > . > You are receiving this because you modified the open/close state.Message > ID: ***@***.***> > -- Joscha Henningsen He/Him
Author
Owner

@wxiaoguang commented on GitHub (Apr 6, 2023):

I guess because you didn't confirm the input in your input method.

The "temp" text is highlighted to show that they are not really in the textarea.

I guess you need to click the "確定" on the virtual keyboard


Let's stop from discussing the new issue on a closed issue, sorry for bothering.

@wxiaoguang commented on GitHub (Apr 6, 2023): I guess because you didn't confirm the input in your input method. The "temp" text is highlighted to show that they are not really in the textarea. I guess you need to click the "確定" on the virtual keyboard ---- Let's stop from discussing the new issue on a closed issue, sorry for bothering.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8986