javascript - Preventing resize of button in contenteditable div in IE -
javascript - Preventing resize of button in contenteditable div in IE -
we have styled disabled input, of type button, we're using placeholder other content in content editable area. issue ie (we're targeting ie10) appears ignore resizestart event altogether when click on element, you're allowed resize it. want prevent that, still allow element selected , dragged. seem work image.
the story behind selection of element here long winded, assume can't alter element.
update: here's jsfiddle demonstrating issue , relevant sample code here:
<div contenteditable="true"> <input type="button" value="test" disabled="disabled" onresizestart="return false;" onresize="return false;" id="test" /> </div>
this far ideal, works. can capture "mouseup" event of container , reset width , height of command there:
$('#container').mouseup(function(e){ var $btn = $("#test"); $btn.css('width',''); $btn.css('height','') })
this doesn't remove resizing squares , visually user can temporarily resize command mouse button released - command snaps original size.
demo: http://jsfiddle.net/5swkeqh9/2/
javascript html resize contenteditable
Comments
Post a Comment