vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 403 forks source link

Copy/Paste only first paragraph is pasted in input #637

Closed bmickoski closed 7 years ago

bmickoski commented 7 years ago

I am using angular-xeditable. After reaching to max allowed number of characters i am disabling button and showing error message. This is working fine on all browsers. However if i copy paste text that is in paragraphs in IE onlt first paragraph is pasted, on FF and Chrome is good. For example if e-ta-max is set to 10 and i try to copy paste this text in input on IE :

asadfasdd

ABC

only asadfasdd os being paste. Does we have some solution for this or unfortunately this is something that browser is doing and we cannot do nothing about that... Thanks.

<form editable-form name="$parent.editablePhaseNotes{{$index}}">
<div class="text-left col-md-9">
                                    <a  class="clickable" editable-text="phase.notes" e-placeholder = "enter text" onaftersave="updateNotes($data, phase)" e-ta-max-text="10" e-name="details" ng-click="openForm($index, 'editablePhaseNotes');" ng-show="!$parent.editablePhaseNotes{{$index}}.$visible" data-ng-disabled="!reviewEditMode" data-ng-class="{'not-allowed': true}">
                                    </a>
                                      <div ng-show="$parent.editablePhaseNotes{{$index}}.details.$error.taMaxText" class="text-danger">Character length has been exceeded</div>
                                </div>
 </form>
ckosloski commented 7 years ago

Why not use edtiable-textarea since you are using multi-line data?

bmickoski commented 7 years ago

Well I wanted to go with editable-textarea but requirement is to use simple text and if text is bigger than 65 characters I am showing tooltip.. stupid but that is how I must go...

ckosloski commented 7 years ago

As far as I know, line are only allowed in textarea's. Maybe you could style the textarea to look more like a normal input. Or maybe you have an "on-paste" method that strips out the line breaks.

bmickoski commented 7 years ago

Hey @ckosloski I agree with you. If we want lines (paragraphs) we need to use textareas.. I was just curious because I see that in Text Angular there was made PR that fix this on Chrome and Mozilla but not FF... Thanks anyway I will close PR.