Skip to content

Commit 61803c0

Browse files
committed
Fixed the wrong behavior with an empty query.
1 parent 706e029 commit 61803c0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/src/main/java/com/ladsers/passtable/android/activities/TableActivity.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,8 @@ class TableActivity : AppCompatActivity() {
386386
}
387387

388388
private fun editItem(blockClosing: Boolean = false) {
389+
if (tagPanel.searchModeIsActive && tagPanel.lastSearchQuery.isEmpty())
390+
tagPanel.switchPanel() // it is necessary to fix the wrong behavior with empty query
389391
val tableId = if (itemList[editId].id == -1) editId else itemList[editId].id
390392
val intent = Intent(this, EditActivity::class.java)
391393
intent.putExtra("dataTag", table.getTag(tableId))
@@ -447,6 +449,8 @@ class TableActivity : AppCompatActivity() {
447449
}
448450

449451
private fun addItem() {
452+
if (tagPanel.searchModeIsActive && tagPanel.lastSearchQuery.isEmpty())
453+
tagPanel.switchPanel() // it is necessary to fix the wrong behavior with empty query
450454
val intent = Intent(this, EditActivity::class.java)
451455
tagPanel.findActiveTag().let { intent.putExtra("dataTag", it) } // preselect tag
452456
disableLockFileSystem = true // for Table activity

0 commit comments

Comments
 (0)