#11510 closed defect (fixed)
The auto preview xhr request is sent on Firefox with IME active even if a user is inputting text
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 0.12.6 |
Component: | ticket system | Version: | 1.0-stable |
Severity: | minor | Keywords: | |
Cc: | Jun Omae | Branch: | |
Release Notes: |
Fix auto-preview not working when editing using IMEs on Firefox and using "cut" and "paste" of context menu. |
||
API Changes: | |||
Internal Changes: |
Description
This issue is occurred on Firefox only with special state. Because, Firefox never fired the keydown
or keypress
event with IME active. I confirmed this is not reproduced on Chrome32 and IE8.
However, for IME user (Asian people only?), we are typing alphabetical character and mother language switching the IME mode. So, the auto preview xhr request is sent since it is not called clearTimeout
during inputting own language.
It can be avoided to observe the input
event for INPUT and TEXTAREA.
Attachments (0)
Change History (9)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
comment:3 by , 11 years ago
I updated my patch by adding the propertychange
event for IE8.
https://github.com/t2y/trac/commit/5a1d31146711cd8193fbf1d35dc2e11f9db134ba
comment:4 by , 11 years ago
It would be simple to add input
event to detect editing using IMEs while auto-preview.
ref. https://developer.mozilla.org/en-US/docs/Web/Reference/Events/input.
-
trac/htdocs/js/auto_preview.js
diff --git a/trac/htdocs/js/auto_preview.js b/trac/htdocs/js/auto_preview.js index c0c790a..29ccda2 100644
a b 92 92 } 93 93 94 94 var values = form.serializeArray(); 95 return inputs.each(function() { 96 $(this).keydown(trigger).keypress(trigger).change(trigger).blur(trigger); 97 }); 95 // use "input" event to detect editing using IMEs on Firefox (#11510) 96 return inputs.bind('input keydown keypress change blur', trigger); 98 97 }; 99 98 100 99 // Enable automatic previewing to <textarea> elements. … … 150 149 return true; 151 150 } 152 151 153 $(this).keydown(trigger).keypress(trigger).blur(trigger); 152 // use "input" event to detect editing using IMEs on Firefox (#11510) 153 $(this).bind('input keydown keypress blur', trigger); 154 154 }); 155 155 }; 156 156 })(jQuery);
comment:6 by , 11 years ago
Milestone: | 1.0.3 → 0.12.6 |
---|---|
Owner: | set to |
Status: | new → assigned |
Also cut and paste of context-menu lead the same issue on Internet Explorer 8 and 11. In Firefox and Chrome, the cut and paste raise "input" event.
I revised my patch. I think we should fix it in 0.12-stable.
-
trac/htdocs/js/auto_preview.js
diff --git a/trac/htdocs/js/auto_preview.js b/trac/htdocs/js/auto_preview.js index c0c790a..a1dfd1b 100644
a b 92 92 } 93 93 94 94 var values = form.serializeArray(); 95 return inputs.each(function() {96 $(this).keydown(trigger).keypress(trigger).change(trigger).blur(trigger);97 });95 // See #11510 96 return inputs.bind('input cut paste keydown keypress change blur', 97 trigger); 98 98 }; 99 99 100 100 // Enable automatic previewing to <textarea> elements. … … 150 150 return true; 151 151 } 152 152 153 $(this).keydown(trigger).keypress(trigger).blur(trigger); 153 // "input" event to detect editing using IMEs on Firefox, 154 // "cut" and "paste" events to detect editing using context 155 // menu on Internet Explorer (#11510) 156 $(this).bind('input cut paste keydown keypress blur', trigger); 154 157 }); 155 158 }; 156 159 })(jQuery);
comment:7 by , 11 years ago
Cc: | added |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
comment:8 by , 11 years ago
Owner: | changed from | to
---|---|
Release Notes: | modified (diff) |
This is a patch to fix for 1.0-stable branch. Could you review it.
https://github.com/t2y/trac/commit/a993e01048578ccb1079f365076b30851c4faadf