You found a bug! We've classified it as
a bug in our system.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
-
Sencha User
[FIXED-87] [3.0RC3] HTMLEditor prepends ? to message
After upgrading from 3.0RC1.1 to RC3, I noticed that the HTML editor now prepends a question mark to its output.
Code:
var window = Ext.getCmp('message-send-window-for-' + record.data.sessionId);
if (!window) {
window = new Ext.Window({
id: 'message-send-window-for-' + record.data.sessionId,
title: 'Send message to ' + record.data.userId,
width: 550,
height: 350,
minWidth: 400,
minHeight: 350,
layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: [
{
id: 'message-send-form-for-' + record.data.sessionId,
xtype: 'form',
cls: 'x-plain',
layout: 'fit',
items:
{
xtype: 'htmleditor',
name: 'message'
}
}
],
buttons: [
{
text: 'Send',
handler: function() {
var formPanel = Ext.getCmp('message-send-form-for-' + record.data.sessionId);
formPanel.getForm().submit({
url: Servlets.messageServlet + '?q=post',
params: {sessionId: record.data.sessionId},
waitMsg: 'Sending',
success: function() {
Ext.MessageBox.alert('Confirm', 'Message sent');
window.hide();
},
failure: function() {
Ext.MessageBox.alert('Error', 'Message was not sent');
}
});
}
}
]
});
}
window.show();
After typing "Hello" into the editor window and hitting "Send", the servlet receives
Code:
q -> post
sessionId -> 367d5247016ff06a8efaedfc6b48
message -> ?Hello
Is it a bug or am I missing something here?
Thanks,
--Al
-
Which browsers have you tested this in?
Twitter - @evantrimboli
Former Sencha framework engineer, available for consulting.
As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.
-
That is probably the &?#8203;? character that is used in an empty HtmlEditor.
(it is shown as a question mark in a character encoding that doesn't support it)
-
Sencha User

Originally Posted by
evant
Which browsers have you tested this in?
Chrome and Safari4. I think Firefox does it too. Haven't tried IE.
-
Sencha User

Originally Posted by
Condor
That is probably the &?#8203;? character that is used in an empty HtmlEditor.
(it is shown as a question mark in a character encoding that doesn't support it)
Yeah, I figured as much, but shouldn't this character go away when the editor is *not* empty?
-
Sencha User
Yes, and even if the editor *is* empty, it shouldn't be passed as the underlying value for the field. The sole purpose of this zero-width character (previously a space was used) is to cause the cursor to show up in FF.

Originally Posted by
agfk
Yeah, I figured as much, but shouldn't this character go away when the editor is *not* empty?
-
Sencha User
I have encountered this problem, too. If you press backspace befeore typing any letter, the question mark is not prepended. In other cases, it does. Initially setting the field to '' using setValue or setRawValue does not work, either.
-
Sencha User
The problem is the following comparison in cleanHtml():
Code:
if(html == this.defaultValue){
html = '';
}
The comparison always returns false because this.defaultValue contains the 7-character string
whereas html contains the actual zero-width space character.
-
Sencha User
-
Confirmed, we'll look into it.
Twitter - @evantrimboli
Former Sencha framework engineer, available for consulting.
As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.