fix(recipes): allow Enter to add import tags

This commit is contained in:
pixelpaws
2026-03-27 19:28:58 +08:00
parent a5191414cc
commit 20e50156a2
2 changed files with 75 additions and 0 deletions

View File

@@ -6,8 +6,27 @@ export class RecipeDataManager {
this.importManager = importManager;
}
setupTagInputEnterHandler() {
const tagInput = document.getElementById('tagInput');
if (!tagInput || tagInput.hasEnterAddTagHandler) {
return;
}
tagInput.addEventListener('keydown', (event) => {
if (event.key !== 'Enter') {
return;
}
event.preventDefault();
this.addTag();
});
tagInput.hasEnterAddTagHandler = true;
}
showRecipeDetailsStep() {
this.importManager.stepManager.showStep('detailsStep');
this.setupTagInputEnterHandler();
// Set default recipe name from prompt or image filename
const recipeName = document.getElementById('recipeName');