#10911 closed defect (fixed)
Bizarre behavior in EnterKeyHandling plugin
Reported by: | Jared Jurkiewicz | Owned by: | Jared Jurkiewicz |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | Editor | Version: | 1.4.0 |
Keywords: | Cc: | liucougar, Douglas Hays | |
Blocked By: | Blocking: |
Description
Use dijit/tests/test_Editor.html to run the following step
1.) Enable EnterKeyHandling? in DIV mode, then do the following:
- clear the content of the first editor
- enter some text in the first line
- hit enter key for 3 times
- enter some text agian
- hit enter key for 3 times
Then you can get the following:
editor1 onChange handler: <div>test</div><div></div><div> </div><div>test<br /><br/></div><div> </div>
Why the plugin would be leaving/using those double-BR tags when it is in DIV mode?
I cannot for the life of me figure out the plugin flow enough to try and resolve this issue.
Attachments (2)
Change History (22)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
I figured out where the the issue is:
function: handleEnterKey
Section for handling P/DIV/etc. Issue is in the else (where you press enter in the middle of a block.)
This is just letting the 'browser' handle it, and the browser is inserting the double br. The code needs to 'split' the block instead of letting the browser 'handle' it.
Trying to figure out the best way to do that.
comment:3 Changed 11 years ago by
Cc: | wildbill added |
---|---|
Milestone: | tbd → 1.5 |
Okay, so I have a patch for this I think resolves it, more or less. Would like input
comment:4 Changed 11 years ago by
Cc: | Douglas Hays added |
---|
Changed 11 years ago by
Attachment: | EnterKeyHandling.2.patch added |
---|
Patch for enter key issue with enter in the middle of content and in div/p/whatever container mode.
comment:5 Changed 11 years ago by
(In [21672]) Fixing up the EnterKetHandling? plugin to handle enter in the middle of content in a block better. Still needs tests. refs #10911
comment:6 Changed 11 years ago by
comment:7 Changed 11 years ago by
Cc: | wildbill removed |
---|---|
Owner: | set to Jared Jurkiewicz |
Jared and I looked over the code together, it looks good to me....
FYI my login is just bill, but I get CC'd on all tickets automatically.
comment:8 Changed 11 years ago by
FYI, the existing EnterKeyHandling robot test is failing now on IE8 (hopefully just a problem with the test), so it needs to be updated, in addition to adding new tests for hitting enter in the middle of a paragraph.
comment:9 Changed 11 years ago by
Passes for me: {{ LOG: debug: 2 tests to run in 1 groups LOG: debug: ------------------------------------------------------------ LOG: debug: GROUP "blockNodeForEnter=BR / IE tests" has 2 tests to run LOG: debug: PASSED test: initial input 0 ms LOG: debug: Total time for GROUP " blockNodeForEnter=BR / IE tests " is 0ms LOG: debug: PASSED test: type in some text 2812 ms LOG: debug: Total time for GROUP " blockNodeForEnter=BR / IE tests " is 2.8s LOG: debug: WOOHOO!! LOG: debug: ------------------------------------------------------------ LOG: debug: | TEST SUMMARY: LOG: debug: ------------------------------------------------------------ LOG: debug: 2 tests in 1 groups LOG: debug: 0 errors LOG: debug: 0 failures }}
comment:10 Changed 11 years ago by
Passes for me:
LOG: debug: 2 tests to run in 1 groups LOG: debug: ------------------------------------------------------------ LOG: debug: GROUP "blockNodeForEnter=BR / IE tests" has 2 tests to run LOG: debug: PASSED test: initial input 0 ms LOG: debug: Total time for GROUP " blockNodeForEnter=BR / IE tests " is 0ms LOG: debug: PASSED test: type in some text 2812 ms LOG: debug: Total time for GROUP " blockNodeForEnter=BR / IE tests " is 2.8s LOG: debug: WOOHOO!! LOG: debug: ------------------------------------------------------------ LOG: debug: | TEST SUMMARY: LOG: debug: ------------------------------------------------------------ LOG: debug: 2 tests in 1 groups LOG: debug: 0 errors LOG: debug: 0 failures
comment:12 Changed 11 years ago by
Anyway, I suspect if you reran it would pass. Probably a test timing issue. Will look at it when I add the other tests.
comment:13 Changed 11 years ago by
Oh OK, I ran it again and it passed fine (although FullScreen failed on the ctrl-shift-f11 test, maybe there's a timing condition there too).
comment:14 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [21840]) Adding in two simple tests for the EnterKeyHandling? and being inside a block (p/div) somewhere in the content and pressing enter and validating content properly splits. fixes #10911
comment:15 Changed 11 years ago by
comment:19 Changed 11 years ago by
(In [21898]) Tweak to EnterKeyHandling? tests further, mozilla issues. refs #10911
The only thing I have determined so far is this:
It happens when you hit enter before a space at the end of the line.
This engages some sort of 'splitting mode' of the plugin. Not sure why it creates/leaves those double brs, though.