Opened 6 years ago
Closed 6 years ago
#44870 closed defect (bug) (maybelater)
The text will be cleared on codemirror with the Japanese Kanji input
Reported by: | miyauchi | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.9 |
Component: | I18N | Keywords: | has-screenshots has-patch |
Focuses: | administration | Cc: |
Description
If we entered a Japanese character, the text will be cleared.
We can see this problem on Custom HTML widget and editor screens for plugin and themes,
Attachments (2)
Change History (9)
#2
in reply to:
↑ description
@
6 years ago
#4
@
6 years ago
@ryotsun
I tried your patch and it looks good to me.
But I found following in the codemirror documentation:
inputStyle: string
Selects the way CodeMirror handles input and focus. The core library defines the "textarea" and "contenteditable" input models. On mobile browsers, the default is "contenteditable". On desktop browsers, the default is "textarea". Support for IME and screen readers is better in the "contenteditable" model. The intention is to make it the default on modern desktop browsers in the future.
https://codemirror.net/doc/manual.html
I am not sure but I think it should be same behavior with the codemirror default.
So, it shoud be contenteditable
on mobile and it should be textarea
on desktop.(?)
#5
@
6 years ago
@miyauchi
I am not sure but I think it should be same behavior with the codemirror default.
I agree with you. If we follow its default, it doesn’t have to set inputStyle
.
But in this case, it’s a bit hard to do so because there is a known issue on mobile.
cf.)
https://github.com/codemirror/CodeMirror/issues/3137
that’s why, I guess to set textarea
is a better solution for now.
#7
@
6 years ago
- Milestone 4.9.9 deleted
- Resolution set to maybelater
- Status changed from new to closed
- Version changed from 4.9.8 to 4.9
According to the CodeMirror issue, this appears to be a bug that won't be solvable until CodeMirror 6 is released, which is still some time away.
We'll certainly upgrade to CodeMirror 6 when it's released, but I don't think there's anything we can do right now.
Replying to miyauchi:
It seems depending on editor settings of codemirror below.
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/general-template.php#L3207
contenteditable
should betextarea
to fix this issue.$settings = array( 'codemirror' => array( ... 'inputStyle' => 'textarea', ... ), ... );
But I need some assistance because I'm not sure expected impact area.
(Impact area I found so far is not only customHTML widget but also "Theme Editor".)
cf.) https://codemirror.net/doc/manual.html
related issue
it may the related issue..?
https://github.com/codemirror/CodeMirror/issues/3137