contenteditable

contenteditable is not working with cdkDrag

吃可爱长大的小学妹 提交于 2020-04-28 21:07:23
问题 I am trying to use a div element tag and make it behave as a textarea with css. #textarea { -moz-appearance: textfield-multiline; ------------ card.component.css -webkit-appearance: textarea; border: 1px solid gray; font: medium -moz-fixed; font: -webkit-small-control; height: 28px; overflow: auto; padding: 2px; resize: both; width: 400px; } <div id="textarea" contenteditable>I look like a textarea</div> ---- card.component.html But i am using cdkDrag on my card from parent component(Category

HTML5 nested lists: Indented list item without parent possible?

和自甴很熟 提交于 2020-04-18 05:46:03
问题 I'm working on a text editor based on a contenteditable DIV. I'd like to produce valid HTML5, but ran into problems with nesting lists. The following two formatting examples seem to be impossible to create using valid HTML5 because they would require nesting a <ul> element as a direct child of the parent <ul> : Scenario 1: Empty parent item ● ○ nested item with empty parent Scenario 2: Nested item without parent list item ○ nested item without parent I read https://stackoverflow.com/a/5899394

How to prevent contenteditable input event and set model value instead in vue?

孤者浪人 提交于 2020-04-18 05:31:26
问题 I want to create simple wysiwyg editor with vue on contenteditable div. I want to store editor content into json object. I want to use state/model concept. I will do something like this within editor template: <div contenteditable> <component v-for="item in json" :is="item.blockTypeComponent" /> </div> and I will use simple-wysiwyg component with v-model somewhere on my edit page: <simple-wysiwyg v-model="someVarAsJson" /> It looks like I need store editor input data to model/state before and

How to prevent contenteditable input event and set model value instead in vue?

狂风中的少年 提交于 2020-04-18 05:30:33
问题 I want to create simple wysiwyg editor with vue on contenteditable div. I want to store editor content into json object. I want to use state/model concept. I will do something like this within editor template: <div contenteditable> <component v-for="item in json" :is="item.blockTypeComponent" /> </div> and I will use simple-wysiwyg component with v-model somewhere on my edit page: <simple-wysiwyg v-model="someVarAsJson" /> It looks like I need store editor input data to model/state before and

How to create draggable and editable list items using @angular/cdk?

大城市里の小女人 提交于 2020-04-12 00:15:46
问题 I'm trying to create a horizontal draggable list with items that should be editable. For that I'm using the cdk package without material and with the attribute [contentEditable]='true' . But the items are not editable. How do I get it working? <div cdkDropList [cdkDropListOrientation]="'horizontal'" class="namingConventionDragDrop" (cdkDropListDropped)="drop($event)"> <ng-container *ngFor="let item of resultConvention; let i = index;"> <div cdkDrag class="pop naming-placeholder" *ngIf="item

contenteditable not working properly with cdkDrag on google-chrome

£可爱£侵袭症+ 提交于 2020-04-11 21:14:01
问题 I simply trying to make a div editable. It was working like a charm on chrome before adding Drag-n-drop to my component with cdkDrag directive. However, it works fine with FireFox and Edge and it does show the input cursor. <app-note-item *ngFor=" let note of notes" cdkDrag [note] = "note" class="note-item" [cdkDragFreeDragPosition] = "note.position" ></app-note-item> App-note-item : <div contenteditable="true" class="note-content"> {{note.content}} </div> Any help would be grateful. 来源:

div contentEditable but Readonly

不问归期 提交于 2020-04-09 07:56:12
问题 I have a div with some text and I want when the cursor is hover this div to select the text. If I let this div as it is, when trying to select all (CTRL+A) then I select all page content, meaning all body text. To get rid of this, I need to use contenteditable attribute for this div. But I don't want to let people to change the text / copy / cut and so on I try to use readonly for this div, but doesn't working. Any advice please ? PS1: This div has also other tags inside (html content), but I

div contentEditable but Readonly

旧城冷巷雨未停 提交于 2020-04-09 07:51:55
问题 I have a div with some text and I want when the cursor is hover this div to select the text. If I let this div as it is, when trying to select all (CTRL+A) then I select all page content, meaning all body text. To get rid of this, I need to use contenteditable attribute for this div. But I don't want to let people to change the text / copy / cut and so on I try to use readonly for this div, but doesn't working. Any advice please ? PS1: This div has also other tags inside (html content), but I

div contentEditable but Readonly

…衆ロ難τιáo~ 提交于 2020-04-09 07:46:26
问题 I have a div with some text and I want when the cursor is hover this div to select the text. If I let this div as it is, when trying to select all (CTRL+A) then I select all page content, meaning all body text. To get rid of this, I need to use contenteditable attribute for this div. But I don't want to let people to change the text / copy / cut and so on I try to use readonly for this div, but doesn't working. Any advice please ? PS1: This div has also other tags inside (html content), but I

How to pass vue instance to external script?

删除回忆录丶 提交于 2020-03-25 17:36:11
问题 I have this declaration of editor in component vue file: export default { data: function() { return { editor: new Editor({ doc: this.value, vueInstance: this, }), } }, I am using editor.doc for generating template within contenteditable. After each keydown event editor.doc should be changed and template should be updated. It means I need change editor.doc kepping reactivity within Editor() external script like this: vueInstance.$set(this.doc, someKey, someValue); . That is why I pass