1

I'm aware that for input and textarea tags you can specify autocapitalize as off. Is there a way to do this when you are using a content editable div, as they do not have the autocapitalize attribute?

I have seen similar thinks achieved elsewhere, on the likes of online code editors. The orion editor for example uses an editable div and doesn't suffer this problem.

Community
  • 1
  • 1
Jools
  • 839
  • 8
  • 22

2 Answers2

1

I have found a workaround to this. I fill the content editable with a zero width space (​) that the user can't see. Then when they tap and start typing, no auto upper casing!

-1

Add this to the divs style :)

text-transform:lowercase;

I hope this helps!

EDIT

Okay now I understand fully. In an editable div this is not possible to achieve. The variable for this function cannot be controlled by HTML or JS. This is hardcoded into the objective-c of IOS. Nothing can change this unfortuatnly. The only way you could possible achieve what you are trying to do and that is to change the div to an input field, and then use the auto-capitalisation: off.

Apologies its not good news but I hope this helps!

KM123
  • 1,339
  • 1
  • 10
  • 21
  • problem here that it does not only turn off auto-capitalization it prevents upper case letters. So even if you want to capitalize a letter it's not possible. – iCaramba May 23 '14 at 10:51
  • That would completely disable all capitalisation. I'm looking to disable **auto**-capitalisation. (as @VWGolf2 said) – Jools May 23 '14 at 11:02
  • I just added a related link that seems to achieve this. I don't know how, but it seems possible. – Jools May 23 '14 at 11:25