Pesquisar no apoio

Evite burlas no apoio. Nunca iremos solicitar que telefone ou envie uma mensagem de texto para um número de telefone ou que partilhe informações pessoais. Por favor, reporte atividades suspeitas utilizando a opção "Reportar abuso".

Learn More

Contenteditable cannot click into

  • 4 respostas
  • 1 tem este problema
  • 6 visualizações
  • Última resposta por 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

Modificado por cor-el a

Todas as respostas (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."