Vyhľadajte odpoveď

Vyhnite sa podvodom s podporou. Nikdy vás nebudeme žiadať, aby ste zavolali alebo poslali SMS na telefónne číslo alebo zdieľali osobné informácie. Nahláste prosím podozrivú aktivitu použitím voľby “Nahlásiť zneužitie”.

Learn More

Contenteditable cannot click into

  • 4 odpovede
  • 1 má tento problém
  • 6 zobrazení
  • Posledná odpoveď od Col_Boogie

more options

I have code : <td>&spades;<span contenteditable="true" id='NS'></span> I can tab into the span field, but if I click on it I cannot edit it. Problem goes away if there is something in the field

I have code : &lt;td&gt;&amp;spades;&lt;span contenteditable="true" id='NS'&gt;&lt;/span&gt; I can tab into the span field, but if I click on it I cannot edit it. Problem goes away if there is something in the field

Upravil(a) cor-el dňa

Všetky odpovede (4)

more options

Col_Boogie said

<td>♠<span contenteditable="true" id='NS'></span>

Should it be possible to move the cursor into an empty span if the containing element is not contenteditable? Hmm, that isn't mentioned here:

https://developer.mozilla.org/docs/Web/API/HTMLElement/contentEditable

If Firefox isn't following web standards, that would be a good argument for fixing it. Otherwise, it would probably considered an optional fix.

What does Chrome do?

more options

Checked Chrome: If I click just after the card suit, it works. Also note that for Firefox, if I click just before the suit, I can then tab to the editable field. I tried adding: span {spellcheck="false"; min-width:3em} no help. Note the spellcheck="false"; is ignored. I have to right click screen to turn it off.

more options

spellcheck="false" would be an attribute like contenteditable="true" and thus not part of a style rule.

more options

Sorry, you are right about spellcheck. Sometimes I wish there were HTML style-attribute rules. Would save a lot of coding. Maybe <HTML-attributes> ... </HTML-attributes> and <... style="...; HTML: attribute1, attribute2, etc."