Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungWhy Claude Code keeps writing shell commands that fail on your Mac(20.09.2026 um 21:06 Uhr)
Sichere Programmierungllms.txt v2: What the Spec Says, and What 137,000 Domains Show(20.09.2026 um 21:17 Uhr)
Sicherheitslücken (CVE)NiceTryGPT: Less pattern matching. More actual hacking.(20.09.2026 um 21:19 Uhr)
IT Security VideoActivities BoF (kde2026)(20.09.2026 um 00:00 Uhr)
IT Security Toolsirdoc-app(20.09.2026 um 20:33 Uhr)
Sichere ProgrammierungWhy Claude Code keeps writing shell commands that fail on your Mac(20.09.2026 um 21:06 Uhr)
Sichere Programmierungllms.txt v2: What the Spec Says, and What 137,000 Domains Show(20.09.2026 um 21:17 Uhr)
Sicherheitslücken (CVE)NiceTryGPT: Less pattern matching. More actual hacking.(20.09.2026 um 21:19 Uhr)
IT Security VideoActivities BoF (kde2026)(20.09.2026 um 00:00 Uhr)
IT Security Toolsirdoc-app(20.09.2026 um 20:33 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Why My React Native ScrollView Would Not Scroll Inside a Share Preview Modal

Reagiere als Erste:r — dein Feedback zählt!

This article is an English translation of the original Japanese article.

This is a submission for DEV's Summer Bug Smash: Smash Stories powered by Sentry.

In a modal for converting and sharing monthly schedules as an image, the share button was pushed off screen only for months with many events. The preview was in a ScrollView, but it would not scroll.

The problem was not the image conversion, but specifying flex: 1 on a ScrollView inside a modal where the height was not fixed.

Why the symptom was misleading

The preview scrolled correctly for short months because its content already fit. It failed only when enough schedule rows made the preview taller than the device. Since the component was a ScrollView, the first suspects were gesture handling and scroll configuration.

The real issue was one level higher: no ancestor gave the scroll container a definite viewport to scroll within.

Layout Where the Problem Occurred

The outer sheet had maxHeight: "85%", and the inner preview had flex: 1.

<View style={styles.sheet}>
  <Header />
  <ScrollView style={styles.preview}>
    <ShareImagePreview />
  </ScrollView>
  <ShareButton />
</View>
const styles = StyleSheet.create({
  sheet: { maxHeight: "85%" },
  preview: { flex: 1, minHeight: 160 },
});

The outer container has a content-dependent height, with only an upper limit specified as a percentage. Inside, the ScrollView could not determine the remaining available height, so it rendered at the full height of its content. As a result, the sheet itself extended off screen.

Creating a Fixed Value from Screen Height

I retrieved the screen height with useWindowDimensions and passed a point value maxHeight to the preview.

const { height: windowHeight } = useWindowDimensions();
const previewMaxHeight = Math.max(160, windowHeight * 0.85 - 320);

<ScrollView
  style={[styles.preview, { maxHeight: previewMaxHeight }]}
  contentContainerStyle={styles.previewContent}
>
  <ShareImagePreview />
</ScrollView>

320 is the area used for the header, tabs, share button, and margins. It is not a strict design token, but on this screen I treat it as the value to subtract for the fixed parts inside the sheet. To avoid the preview disappearing on small devices, I set the lower limit to 160.

preview: {
  minHeight: 160,
  borderWidth: 1,
  borderRadius: 10,
}

Separating Capture Target from Display Area

When creating a long image with react-native-view-shot, the preview size on screen and the full image size to export are not necessarily the same. What I limited this time was the viewing area on the modal. It was not a change to trim the shared View content.

I confirmed the following three points:

  • For months with few events, margins do not become unnaturally wide
  • For months with many events, the preview can be scrolled
  • On small devices, the share button remains reachable

The impact of the fix

The modal now keeps its controls reachable across both content length and screen size. Long schedule previews scroll inside a bounded viewing area, while the exported image still contains the complete schedule rather than a cropped viewport.

This separation also clarified two responsibilities that had been mixed together:

  • The modal owns the available on-screen height.
  • The capture target owns the full shareable content size.

What I learned

When a ScrollView does not scroll, I first want to suspect the scroll settings. However, if there is no fixed height anywhere in the parent-child hierarchy, it is calculated as a large View that does not need scrolling. If percentage specifications and flex: 1 overlap inside a modal, providing a fixed height or maxHeight once makes it easier to isolate the issue.

A scrollable component needs both overflowing content and a constrained viewport. Checking only the ScrollView props missed half of that contract. Tracing the height calculation from the modal down to the preview exposed the bug much faster.

References

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-93956 | A flaw has been found in olivier-ls PHP-FTS up to 1.1.2. Affected by thi…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick