AnanthaKN / jquery-in-place-editor

Automatically exported from code.google.com/p/jquery-in-place-editor
Other
0 stars 0 forks source link

Div close without text -> can not be edit any more #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. click on edit-on-place-div
2. write nothing, quit the div with esc or enter or click on other
edit-on-place-div
3. the edit-on-place-div close without request and can not be edit anymore

What version of the product are you using? On what operating system?
2.0, Ubuntu 10.04, Firefox, jQuery 1.3.2

Original issue reported on code.google.com by stefanga...@gmail.com on 13 May 2010 at 8:34

GoogleCodeExporter commented 9 years ago
Does this only happen on Firefox?

In any case, could you please provide a reduction of how this happens?

 Because I was unable to reproduce this (and have explicit tests for this in my testsuite that seem to run in every 
browser I've tested (well, except IE).

Original comment by mhaec...@gmail.com on 13 May 2010 at 4:56

GoogleCodeExporter commented 9 years ago
Yes only Firefox

Original comment by stefanga...@gmail.com on 21 May 2010 at 7:20

GoogleCodeExporter commented 9 years ago
Firefox have problems with empty strings.
Fixed in the removeInsertedDefaultTextIfNeccessary function:

replace this:
this.dom.html('');

with this:
this.dom.html(' ');

Original comment by stefanga...@gmail.com on 21 May 2010 at 12:35

GoogleCodeExporter commented 9 years ago
Could you please provide more info on this one? I've tried this with Firefox 
3.0, 3.5 and 3.6 and couldn't 
reproduce the problem in either of those.

here's what I tried in the testsuite:

    it 'firefox can reinitialize on div with empty editor'
      this.sandbox = $('<p>')
      this.edit({}, '')
      this.sandbox.should.not.have_tag 'form'
      this.openEditor()
      this.sandbox.should.have_tag 'form'
    end

Do I miss someting?

Original comment by mhaec...@gmail.com on 22 May 2010 at 4:42

GoogleCodeExporter commented 9 years ago
Could you please provide more info on this one? I've tried this with Firefox 
3.0, 3.5 and 3.6 and couldn't 
reproduce the problem in either of those.

here's what I tried in the testsuite:

    it 'firefox can reinitialize on div with empty editor'
      this.sandbox = $('<p>')
      this.edit({}, '')
      this.sandbox.should.not.have_tag 'form'
      this.openEditor()
      this.sandbox.should.have_tag 'form'
    end

Do I miss someting?

Original comment by mhaec...@gmail.com on 22 May 2010 at 4:42

GoogleCodeExporter commented 9 years ago
Go to the demo-site on example 1
* click on the text
* delete the text
* click enter

ON IE 6 on WINDOWS XP:

i get an alert: undefined, and after click ok to the alert it's reproduce the 
text of
example 1.
RIGHT!

ON IE FIREFOX 3.6.3 on WINDOWS XP:

i do not get any alert and i can not edit the example 1 any more.
WRONG!

i hope you understand

Regards

Original comment by stefanga...@gmail.com on 25 May 2010 at 9:14

GoogleCodeExporter commented 9 years ago
Ah, now I get it.

I think the problem is more with IE 6 than with Firefox here. You see, the 
empty string is perfectly acceptable as the new content of the div (why IE 6 
refuses I have no clue but I can check that).

The problem you see probably is that in the demo the size of the clickable area 
is only the size of the string it shows, which is reduced to nothing if no 
string is entered. The element however is still there.

If you want to support empty strings in your app you would need some css to 
ensure the clickable area for the in place editor is still there, even if it 
has no content.

Original comment by mhaec...@gmail.com on 13 Jun 2010 at 12:19

GoogleCodeExporter commented 9 years ago
So to close this: if you want an empty string to be clickeable, give it a 
width: and height:

:)

Original comment by mhaec...@gmail.com on 28 Jan 2011 at 11:04