My current setup involves using a div element with the contenteditable attribute. On keypress, I have restricted editing to 15 characters. When the focus is lost, the div becomes uneditable. Below is the code snippet that I am working with:
<div id="test" contenteditable="{{isContentEditable}}" onkeypress="return (this.innerHTML.length <= 15)"
ng-blur="handleEditableBlur();" ng-keydown="handleKeydown($event)"> {{value}}
</div>
<span id="pencilIcon" class="fa fa-pencil" data-ng-click="handleEdit();" focus="test"></span>
After clicking the pencil icon, the contenteditable property is set to true. Once the text exceeds 15 characters, it becomes uneditable again. While this functionality works perfectly in Chrome, there seems to be an issue with Firefox.