fix: ensure tag input maintains focus after adding tags [dev]
Some checks failed
Basil CI/CD Pipeline / Code Linting (push) Successful in 1m21s
Basil CI/CD Pipeline / Shared Package Tests (push) Successful in 1m10s
Basil CI/CD Pipeline / Web Tests (push) Successful in 1m40s
Basil CI/CD Pipeline / API Tests (push) Successful in 1m52s
Basil CI/CD Pipeline / Build All Packages (push) Has been cancelled
Basil CI/CD Pipeline / E2E Tests (push) Has been cancelled
Basil CI/CD Pipeline / Build & Push Docker Images (push) Has been cancelled
Basil CI/CD Pipeline / Trigger Deployment (push) Has been cancelled
Basil CI/CD Pipeline / Security Scanning (push) Has been cancelled
Some checks failed
Basil CI/CD Pipeline / Code Linting (push) Successful in 1m21s
Basil CI/CD Pipeline / Shared Package Tests (push) Successful in 1m10s
Basil CI/CD Pipeline / Web Tests (push) Successful in 1m40s
Basil CI/CD Pipeline / API Tests (push) Successful in 1m52s
Basil CI/CD Pipeline / Build All Packages (push) Has been cancelled
Basil CI/CD Pipeline / E2E Tests (push) Has been cancelled
Basil CI/CD Pipeline / Build & Push Docker Images (push) Has been cancelled
Basil CI/CD Pipeline / Trigger Deployment (push) Has been cancelled
Basil CI/CD Pipeline / Security Scanning (push) Has been cancelled
- Add focus restoration after recipe state update - Add focus in finally block to ensure it happens even on error - Keeps cursor in tag input field for rapid tag entry Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -164,6 +164,8 @@ function RecipeDetail() {
|
|||||||
const response = await recipesApi.getById(id);
|
const response = await recipesApi.getById(id);
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
setRecipe(response.data);
|
setRecipe(response.data);
|
||||||
|
// Restore focus after state update
|
||||||
|
setTimeout(() => tagInputRef.current?.focus(), 0);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Failed to add tag:', err);
|
console.error('Failed to add tag:', err);
|
||||||
@@ -172,6 +174,8 @@ function RecipeDetail() {
|
|||||||
await loadRecipe(id);
|
await loadRecipe(id);
|
||||||
} finally {
|
} finally {
|
||||||
setSavingTags(false);
|
setSavingTags(false);
|
||||||
|
// Ensure focus is maintained
|
||||||
|
setTimeout(() => tagInputRef.current?.focus(), 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
14
traefik-local/dynamic-dev.yml
Normal file
14
traefik-local/dynamic-dev.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
http:
|
||||||
|
routers:
|
||||||
|
basil-dev:
|
||||||
|
rule: "Host(`localhost`) || Host(`127.0.0.1`)"
|
||||||
|
entryPoints:
|
||||||
|
- http
|
||||||
|
service: basil-dev-service
|
||||||
|
priority: 1000 # Higher priority than Docker labels (default is 0)
|
||||||
|
|
||||||
|
services:
|
||||||
|
basil-dev-service:
|
||||||
|
loadBalancer:
|
||||||
|
servers:
|
||||||
|
- url: "http://basil-web:80"
|
||||||
20
traefik-local/traefik.yml
Normal file
20
traefik-local/traefik.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Static Traefik configuration for local development
|
||||||
|
entryPoints:
|
||||||
|
http:
|
||||||
|
address: ":80"
|
||||||
|
|
||||||
|
providers:
|
||||||
|
docker:
|
||||||
|
endpoint: "unix:///var/run/docker.sock"
|
||||||
|
exposedByDefault: false
|
||||||
|
network: traefik
|
||||||
|
file:
|
||||||
|
filename: /dynamic-dev.yml
|
||||||
|
watch: true
|
||||||
|
|
||||||
|
api:
|
||||||
|
insecure: true
|
||||||
|
dashboard: true
|
||||||
|
|
||||||
|
log:
|
||||||
|
level: INFO
|
||||||
Reference in New Issue
Block a user