File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,9 @@ export default class TagInput extends LitElement {
4
4
/* eslint-disable indent */
5
5
render ( ) {
6
6
return html `
7
- <div class= 'tags' tabindex = "0" contenteditable = "true" >
7
+ <div class= 'tags' tabindex = "0" >
8
8
${ Array . isArray ( this . value ) && this . value . length > 0
9
- ? html `${ this . value . map ( ( v ) => html `
10
- <span contenteditable= "false" class = 'tag' > ${ v } </ span>
11
- ` ) } `
9
+ ? html `${ this . value . map ( ( v ) => html `<span class= 'tag' > ${ v } </ span> ` ) } `
12
10
: ''
13
11
}
14
12
<input type= "text" class = 'editor' @paste = "${ this . afterPaste } " @keydown = "${ this . afterKeyDown } " placeholder = "${ this . placeholder } " >
@@ -43,9 +41,11 @@ export default class TagInput extends LitElement {
43
41
e . target . value = '' ;
44
42
}
45
43
} else if ( e . keyCode === 8 ) {
46
- if ( Array . isArray ( this . value ) && this . value . length > 0 ) {
47
- this . value . splice ( - 1 ) ;
48
- this . value = [ ...this . value ] ;
44
+ if ( e . target . value . length === 0 ) {
45
+ if ( Array . isArray ( this . value ) && this . value . length > 0 ) {
46
+ this . value . splice ( - 1 ) ;
47
+ this . value = [ ...this . value ] ;
48
+ }
49
49
}
50
50
}
51
51
}
@@ -73,7 +73,7 @@ export default class TagInput extends LitElement {
73
73
color : var (--fg3 );
74
74
border-radius : var (--border-radius );
75
75
word-break : break-all;
76
- font-size : calc ( var (--font-size-small ) + 1 px );
76
+ font-size : var (--font-size-small );
77
77
}
78
78
.tag : hover ~ # cursor {
79
79
display : block;
You can’t perform that action at this time.
0 commit comments