Ios Keyboard Page Shift logo

Ios Keyboard Page Shift

Organization
etherfunlab
ios-keyboard-page-shift

Use when, on iPhone Safari or an iOS WebView, a page or a full-screen app shell (top bar, scrolling list, bottom input) moves up when a text field is focused and stays up after the keyboard closes, leaving the top bar off-screen, the input mid-screen and an empty band below it, or when an earlier fix for that symptom did not hold.

Overview

Publisheretherfunlab
Repositoryworkflow
Skill nameios-keyboard-page-shift
Stars
75
Forks
17
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by etherfunlab on GitHub. Read the source before you install it.

Installation

Install the Ios Keyboard Page Shift AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/etherfunlab/workflow/tree/main/skills/ios-keyboard-page-shift/agent/skills/ios-keyboard-page-shift
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/etherfunlab/workflow.git /tmp/workflow
mkdir -p .claude/skills
cp -r /tmp/workflow/skills/ios-keyboard-page-shift/agent/skills/ios-keyboard-page-shift .claude/skills/ios-keyboard-page-shift
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ios Keyboard Page Shift in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ios Keyboard Page Shift on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ios Keyboard Page Shift is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

iOS keyboard page shift

Overview

To show a focused field above the soft keyboard, iOS scrolls two kinds of things: every ancestor of the field that is a scroll container with room to scroll, and the document itself. Either one can be left displaced after the keyboard closes, and both give the same screenshot. Find which layer moved before fixing anything; a fix on the other layer changes nothing.

Step 1: find the layer

Look at what fills the band below the input.

Band below the inputLayer that movedFix
The app's own background, continuous with the rest of the screenan inner scroll containerA
The bare html/body color, with a hard edge where the app's background endsthe documentB

Confirm on the device: Safari on a Mac → Develop → the iPhone, focus the field, close the keyboard, then run:

js
for (let el = document.activeElement; el; el = el.parentElement) {
  const oy = getComputedStyle(el).overflowY
  if (oy !== 'visible' && oy !== 'clip' && el.scrollHeight > el.clientHeight) console.log(el, oy, el.scrollTop)
}
console.log('document', scrollY, visualViewport.offsetTop, visualViewport.height, innerHeight, document.documentElement.scrollHeight)

Any listed element other than the list that is meant to scroll, or with a non-zero scrollTop, means Fix A. scrollY above scrollHeight - innerHeight means Fix B. Both can be true; do A, then B.

Fix A: no outer layer can scroll

An ancestor of the field is a scroll container (overflow auto, scroll or hidden; hidden still scrolls for scripts and for iOS) and has scrollable overflow. The usual source is an absolutely positioned descendant (an sr-only label, a badge, a tooltip) whose containing block lies outside the element meant to scroll. It neither scrolls nor clips with that element, stays at its unscrolled position as far down as the list is long, and adds to the overflow of the next scroll container up.

  1. Make the element meant to scroll the containing block: position: relative on it.
  2. Give shell layers that must never scroll overflow: clip. It clips like hidden but is not a scroll container, so nothing can park it off-axis.

Find escaped elements with list set to the element meant to scroll:

js
for (const el of list.querySelectorAll('*'))
  if (getComputedStyle(el).position === 'absolute' && !list.contains(el.offsetParent)) console.log(el, el.offsetParent)

Fix B: clamp the document after the keyboard closes

iOS should clamp the document back into range when the keyboard closes. From iOS 26 it sometimes does not; WKWebView on iOS 11 to 13.3 had the same bug. Install keyboard-scroll-restore.js (next to this file) once per page load, client side only. It clamps scrollY into [0, scrollHeight - innerHeight] when either:

  • the visual viewport goes from at least 150 px shorter than innerHeight (zoom factored out) back to full: a keyboard closed while focus stayed on the field;
  • 400 ms after a focusout that leaves no input, textarea, select or contenteditable focused: Done, or a send button that blurs. This covers iOS never reporting the viewport growing back, or reporting it before it settles its own scroll.

Each condition is load-bearing:

ConditionWithout it
clamp to the range, not to 0pages that scroll as the document jump to the top
keyboard counted as closed within 150 px of innerHeightiOS 26 can leave the viewport ~24 px short, so an exact-equality check never fires
act only once the keyboard is downthe field gets pulled under the keyboard
wait out the hide animationiOS undoes a clamp made mid-animation
skip when focus moved to another fieldthe page jumps while the user moves between fields

Verify

Only a real iPhone shows this; desktop Safari and Playwright WebKit have no soft keyboard. Close the keyboard with Done and with the send button, move focus between two fields, and on a long page scrolled halfway close the keyboard from a field (the position must stay). If the fix does not hold, log the document line from Step 1 on the device before changing anything.

Common mistakes

MistakeWhat happens
Painting the app background on htmlThe band looks right; the page is still shifted
position: fixed on body or the rootBreaks pages that scroll as the document; iOS still pans the visual viewport
Resizing the shell to visualViewport.height on every resizeJitters as Safari's toolbar collapses
Fixing layer A when the band is the bare canvasNothing changes

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ios Keyboard Page Shift AI skill do?

Use when, on iPhone Safari or an iOS WebView, a page or a full-screen app shell (top bar, scrolling list, bottom input) moves up when a text field is focused and stays up after the keyboard closes, leaving the top bar off-screen, the input mid-screen and an empty band below it, or when an earlier fix for that symptom did not hold.

Why use Ios Keyboard Page Shift on TypingMind?

Because you install it once and use it with any model. Ios Keyboard Page Shift is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ios Keyboard Page Shift in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/etherfunlab/workflow/tree/main/skills/ios-keyboard-page-shift/agent/skills/ios-keyboard-page-shift. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ios Keyboard Page Shift?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ios Keyboard Page Shift?

As many as you like. As long as a model supports skills, you can use Ios Keyboard Page Shift with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ios Keyboard Page Shift AI skill free?

Yes. It is published on GitHub by etherfunlab under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇