When creating a text with a contenteditable area, I encountered an issue: I wanted the contenteditable area to have a minimum width so that users could still see the area even after deleting text. To achieve this, I used display:inline-block. However, the contenteditable area does not break to the next line; it only expands. When I remove display:inline-block, the contenteditable area breaks to the next line when reaching the end of the line, but then I lose the ability to set a min width, resulting in the text disappearing when deleted by the user and requiring a page reload. How can I achieve both functionalities?
span.a{
display:inline-block;
min-width:20px;
border:1px solid black;
}
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, <span class="a" contenteditable="true" >AAAAAAAAAAAAAAAAAAAAA </span> took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages,
and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.