SUPPORT-9304: добавил опцию на запрет очистки
This commit is contained in:
parent
d80b01b55b
commit
53fb753e0f
1 changed files with 3 additions and 1 deletions
|
|
@ -61,6 +61,8 @@ export class DropdownTreeViewComponent extends InputControl {
|
|||
public valueChangeEvent: Event<TreeItemDto> = new Event<TreeItemDto>();
|
||||
@AdvancedProperty()
|
||||
public skipInitialSelection: boolean;
|
||||
@AdvancedProperty()
|
||||
public allowClear: boolean = true;
|
||||
@NotNull()
|
||||
public preferBusinessId: boolean = false;
|
||||
private rpcService: TreeItemRpcService;
|
||||
|
|
@ -272,7 +274,7 @@ export class DropdownTreeViewComponent extends InputControl {
|
|||
|
||||
onKeyDown(event: KeyboardEvent): void {
|
||||
const isInput = (event.target as HTMLElement).tagName === 'INPUT';
|
||||
if (EventUtils.isKeyBackspace(event) && !isInput && this.value) {
|
||||
if (EventUtils.isKeyBackspace(event) && !isInput && this.value && this.allowClear) {
|
||||
this.clearValue();
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue