mirror of https://github.com/Chocobozzz/PeerTube
Fix adding tags on android
parent
017b8e3b39
commit
5801d519a7
|
@ -5,4 +5,5 @@
|
||||||
[inputId]="inputId"
|
[inputId]="inputId"
|
||||||
[allowDuplicate]="false"
|
[allowDuplicate]="false"
|
||||||
[caseSensitiveDuplication]="false"
|
[caseSensitiveDuplication]="false"
|
||||||
|
[separator]="separator"
|
||||||
></p-chips>
|
></p-chips>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import { Component, Input, forwardRef } from '@angular/core'
|
import { CommonModule } from '@angular/common'
|
||||||
|
import { Component, Input, OnInit, forwardRef } from '@angular/core'
|
||||||
import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms'
|
import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms'
|
||||||
|
import { isMobile } from '@root-helpers/web-browser'
|
||||||
import { ChipsModule } from 'primeng/chips'
|
import { ChipsModule } from 'primeng/chips'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -13,14 +15,24 @@ import { ChipsModule } from 'primeng/chips'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [ ChipsModule, FormsModule ]
|
imports: [ CommonModule, ChipsModule, FormsModule ]
|
||||||
})
|
})
|
||||||
export class SelectTagsComponent implements ControlValueAccessor {
|
export class SelectTagsComponent implements OnInit, ControlValueAccessor {
|
||||||
@Input({ required: true }) inputId: string
|
@Input({ required: true }) inputId: string
|
||||||
@Input() availableItems: string[] = []
|
@Input() availableItems: string[] = []
|
||||||
@Input() selectedItems: string[] = []
|
@Input() selectedItems: string[] = []
|
||||||
@Input() placeholder = $localize`Enter a new tag`
|
@Input() placeholder = $localize`Enter a new tag`
|
||||||
|
|
||||||
|
separator: string
|
||||||
|
|
||||||
|
ngOnInit () {
|
||||||
|
// FIXME: workaround for https://github.com/primefaces/primeng/issues/13981
|
||||||
|
if (isMobile()) {
|
||||||
|
this.separator = ','
|
||||||
|
this.placeholder = $localize`Use a comma (,) to add a tag`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
propagateChange = (_: any) => { /* empty */ }
|
propagateChange = (_: any) => { /* empty */ }
|
||||||
|
|
||||||
writeValue (items: string[]) {
|
writeValue (items: string[]) {
|
||||||
|
|
Loading…
Reference in New Issue