diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 1cd3571..797b752 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "mindsift-frontend", - "version": "0.5.1", + "version": "0.5.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mindsift-frontend", - "version": "0.5.1", + "version": "0.5.2", "license": "Unlicense", "dependencies": { "@types/prismjs": "^1.26.6", diff --git a/frontend/package.json b/frontend/package.json index 33c9558..a764fec 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "mindsift-frontend", "private": true, - "version": "0.5.1", + "version": "0.5.2", "license": "Unlicense", "type": "module", "scripts": { diff --git a/frontend/src/features/lists/SharedListsView.tsx b/frontend/src/features/lists/SharedListsView.tsx index 964b204..a9bc9cf 100644 --- a/frontend/src/features/lists/SharedListsView.tsx +++ b/frontend/src/features/lists/SharedListsView.tsx @@ -766,13 +766,16 @@ export const SharedListsView: React.FC = ({ onRefreshGloba return result; }, [openItems]); + const focusNewItemInput = () => { + inputRef.current?.focus({ preventScroll: true }); + inputRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' }); + }; + // Register context-sensitive mobile menu groups behind the MindSift logo useEffect(() => { setPrimaryAction(() => { - setTimeout(() => { - inputRef.current?.focus(); - inputRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' }); - }, 60); + // Focus right inside the tap: iOS only opens the keyboard for focus() during the user gesture + focusNewItemInput(); }); setGroups([ @@ -786,10 +789,7 @@ export const SharedListsView: React.FC = ({ onRefreshGloba icon: , variant: 'accent', onClick: () => { - setTimeout(() => { - inputRef.current?.focus(); - inputRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' }); - }, 60); + focusNewItemInput(); }, }, { @@ -1081,7 +1081,8 @@ export const SharedListsView: React.FC = ({ onRefreshGloba setTimeout(() => setShowSuggestions(false), 200); }} placeholder={`Eintrag zu "${activeList.title}" hinzufügen (z. B. Hafermilch #Kühlregal)…`} - className="flex-1 bg-transparent py-1.5 sm:py-1 text-sm text-main placeholder-faint focus:outline-none" + // 16px on phones: iOS zooms into smaller fields and the layout jumps under the keyboard + className="flex-1 bg-transparent py-1.5 sm:py-1 text-base sm:text-sm text-main placeholder-faint focus:outline-none" /> {/* Hashtag Autocomplete Suggestions Dropdown */} @@ -1125,7 +1126,7 @@ export const SharedListsView: React.FC = ({ onRefreshGloba value={newItemQty} onChange={(e) => setNewItemQty(e.target.value.replace(/[^0-9.,xX]/g, ''))} placeholder="Menge (z.B. 2)" - className="flex-1 sm:flex-none sm:w-28 h-9 sm:h-7 px-2.5 sm:px-2 input-field text-xs" + className="flex-1 sm:flex-none sm:w-28 h-11 sm:h-7 px-2.5 sm:px-2 input-field text-base sm:text-xs" />