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>();
|
public valueChangeEvent: Event<TreeItemDto> = new Event<TreeItemDto>();
|
||||||
@AdvancedProperty()
|
@AdvancedProperty()
|
||||||
public skipInitialSelection: boolean;
|
public skipInitialSelection: boolean;
|
||||||
|
@AdvancedProperty()
|
||||||
|
public allowClear: boolean = true;
|
||||||
@NotNull()
|
@NotNull()
|
||||||
public preferBusinessId: boolean = false;
|
public preferBusinessId: boolean = false;
|
||||||
private rpcService: TreeItemRpcService;
|
private rpcService: TreeItemRpcService;
|
||||||
|
|
@ -272,7 +274,7 @@ export class DropdownTreeViewComponent extends InputControl {
|
||||||
|
|
||||||
onKeyDown(event: KeyboardEvent): void {
|
onKeyDown(event: KeyboardEvent): void {
|
||||||
const isInput = (event.target as HTMLElement).tagName === 'INPUT';
|
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();
|
this.clearValue();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue