Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Invalid option used in lookup with emptied dropdown #1744

Merged
merged 2 commits into from Jul 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -214,8 +214,8 @@ export class DropdownEditorBehavior implements IDropdownEditorBehavior{
break;
case "Enter":
const wasDropped = this.isDropped;
if (this.isDropped && !this.isWorking && this.cursorRowId) {
this.data.chooseNewValue(this.cursorRowId);
if (this.isDropped && !this.isWorking) {
this.data.chooseNewValue(this.cursorRowId === "" ? null : this.cursorRowId);
this.dropUp();
}
if (wasDropped) {
Expand All @@ -228,7 +228,7 @@ export class DropdownEditorBehavior implements IDropdownEditorBehavior{
case "Tab":
if (this.isDropped) {
if (this.cursorRowId) {
this.data.chooseNewValue(this.cursorRowId);
this.data.chooseNewValue(this.cursorRowId === "" ? null : this.cursorRowId);
}
}
break;
Expand Down Expand Up @@ -393,6 +393,8 @@ export class DropdownEditorBehavior implements IDropdownEditorBehavior{
private trySelectFirstRow() {
if (this.dataTable.rows.length > 0) {
this.cursorRowId = this.dataTable.getRowIdentifierByIndex(0);
} else {
this.cursorRowId = "";
}
}

Expand Down