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

Javascript error when editing issue description / reply. #23247

Closed
rubenelshof opened this issue Mar 2, 2023 · 2 comments · Fixed by #23168
Closed

Javascript error when editing issue description / reply. #23247

rubenelshof opened this issue Mar 2, 2023 · 2 comments · Fixed by #23168
Labels
topic/ui Change the appearance of the Gitea UI type/bug

Comments

@rubenelshof
Copy link

Description

When editing the description or reply of a issue I get the following Javascript error:

JavaScript error: Uncaught TypeError: i.onChange is not a function (https://git.dionysussg.xyz/assets/js/index.js?v=1.20.0~dev-56-gde6c718b4 @ 60:408). Open browser console to see more details.

Console error:

Uncaught (in promise) TypeError: i.onChange is not a function
    at index.js?v=1.20.0~dev-56-gde6c718b4:60:408
    at easymde.9b7a25f9.js:13:3720
    at Bl (easymde.9b7a25f9.js:13:3200)
    at Ml (easymde.9b7a25f9.js:13:3477)
    at Lr (easymde.9b7a25f9.js:18:7672)
    at Bt.setValue (easymde.9b7a25f9.js:18:10623)
    at H.value (easymde.9b7a25f9.js:49:18586)
    at HTMLAnchorElement.<anonymous> (index.js?v=1.20.0~dev-56-gde6c718b4:96:3618)
    at Generator.next (<anonymous>)
    at _ (index.js?v=1.20.0~dev-56-gde6c718b4:91:7717)

Uncaught TypeError: i.onChange is not a function
    at index.js?v=1.20.0~dev-56-gde6c718b4:60:408
    at easymde.9b7a25f9.js:13:3720
    at Bl (easymde.9b7a25f9.js:13:3200)
    at Ml (easymde.9b7a25f9.js:13:3477)
    at Lr (easymde.9b7a25f9.js:18:7672)
    at HTMLDivElement.<anonymous> (easymde.9b7a25f9.js:18:10332)

Screenshots

image

Gitea Version

1.20.0+dev-56-gde6c718b4

Can you reproduce the bug on the Gitea demo site?

No

Operating System

No response

Browser Version

Chrome 110.0.5481.178

@rubenelshof rubenelshof added type/bug topic/ui Change the appearance of the Gitea UI labels Mar 2, 2023
@delvh
Copy link
Member

delvh commented Mar 2, 2023

I think there is already a PR open to fix it/merged already, I just don't know which one it is.
@wxiaoguang do you know which one it is?

@wxiaoguang
Copy link
Contributor

This one: #23168

The one-line fix: easyMDEOptions?.onChange?.(...args);: https://github.com/go-gitea/gitea/pull/23168/files#diff-5eca01f7999043471c646505421dd1362dc17aeba4f600b72ac1c1e76864d7e1R81

jolheiser pushed a commit that referenced this issue Mar 2, 2023
The reason why quote reply is empty is when quote reply is clicked, it
triggers the click function on `.comment-form-reply` button, and when
the first time this function is triggered, easyMDE for the reply has not
yet initialized, so that click handler of `.quote-reply` button in
`repo-legacy.js` got an `undefined` as easyMDE, and the following lines
which put quoted reply into the easyMDE is not executed.
The workaround in this PR is to pass the replied content to
'.comment-form-reply' button if easyMDE is not yet initialized (quote
reply first clicked) and put the replied content into it the after
easyMDE is created.
Now quote reply on first click:


https://user-images.githubusercontent.com/17645053/221452823-fc699d50-1649-4af1-952e-f04fc8d2978e.mov

<br />


Update:
The above change is not appropriate as stated in the
[comment](#23168 (comment))
Use await instead

Close #22075.
Close #23247.
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Mar 2, 2023
The reason why quote reply is empty is when quote reply is clicked, it
triggers the click function on `.comment-form-reply` button, and when
the first time this function is triggered, easyMDE for the reply has not
yet initialized, so that click handler of `.quote-reply` button in
`repo-legacy.js` got an `undefined` as easyMDE, and the following lines
which put quoted reply into the easyMDE is not executed.
The workaround in this PR is to pass the replied content to
'.comment-form-reply' button if easyMDE is not yet initialized (quote
reply first clicked) and put the replied content into it the after
easyMDE is created.
Now quote reply on first click:


https://user-images.githubusercontent.com/17645053/221452823-fc699d50-1649-4af1-952e-f04fc8d2978e.mov

<br />


Update:
The above change is not appropriate as stated in the
[comment](go-gitea#23168 (comment))
Use await instead

Close go-gitea#22075.
Close go-gitea#23247.
jolheiser pushed a commit that referenced this issue Mar 2, 2023
Backport #23168

The reason why quote reply is empty is when quote reply is clicked, it
triggers the click function on `.comment-form-reply` button, and when
the first time this function is triggered, easyMDE for the reply has not
yet initialized, so that click handler of `.quote-reply` button in
`repo-legacy.js` got an `undefined` as easyMDE, and the following lines
which put quoted reply into the easyMDE is not executed.
The workaround in this PR is to pass the replied content to
'.comment-form-reply' button if easyMDE is not yet initialized (quote
reply first clicked) and put the replied content into it the after
easyMDE is created.
Now quote reply on first click:


https://user-images.githubusercontent.com/17645053/221452823-fc699d50-1649-4af1-952e-f04fc8d2978e.mov

<br />


Update:
The above change is not appropriate as stated in the
[comment](#23168 (comment))
Use await instead

Close #22075.
Close #23247.

Co-authored-by: HesterG <hestergong@gmail.com>
HesterG added a commit to HesterG/gitea that referenced this issue Mar 3, 2023
The reason why quote reply is empty is when quote reply is clicked, it
triggers the click function on `.comment-form-reply` button, and when
the first time this function is triggered, easyMDE for the reply has not
yet initialized, so that click handler of `.quote-reply` button in
`repo-legacy.js` got an `undefined` as easyMDE, and the following lines
which put quoted reply into the easyMDE is not executed.
The workaround in this PR is to pass the replied content to
'.comment-form-reply' button if easyMDE is not yet initialized (quote
reply first clicked) and put the replied content into it the after
easyMDE is created.
Now quote reply on first click:

https://user-images.githubusercontent.com/17645053/221452823-fc699d50-1649-4af1-952e-f04fc8d2978e.mov

<br />

Update:
The above change is not appropriate as stated in the
[comment](go-gitea#23168 (comment))
Use await instead

Close go-gitea#22075.
Close go-gitea#23247.
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants