Skip to content

TSafetyCover - a panel with a protective cover over an area to prevent stray clicks - #1251

Open
belisoful wants to merge 3 commits into
pradosoft:masterfrom
belisoful:safetycover
Open

TSafetyCover - a panel with a protective cover over an area to prevent stray clicks#1251
belisoful wants to merge 3 commits into
pradosoft:masterfrom
belisoful:safetycover

Conversation

@belisoful

@belisoful belisoful commented Aug 28, 2026

Copy link
Copy Markdown
Member

This is an unusual class. I don't think there is an equivalent "control" in other frameworks.

TSafetyCover — click-to-confirm cover control

Adds TSafetyCover (since 4.4.0).
A TPanel whose body content sits behind a click-to-open cover, guarding controls
that act immediately (e.g. a delete button) against accidental activation.

TSafetyCoverdemo.mp4

Features

  • Two-layer guard — a transparent pointer-events guard re-blocks the content
    the instant it closes while a visible face animates; no click-through during
    the close.
  • Open effectsOverlayEffect = Slide / Collapse / None, any
    OverlayDirection (Up/Down/Left/Right + RTL-aware Forward/Backward),
    independent OverlayFade.
  • TimingOpenDelay (pulse), AutoCloseDelay, MouseOutTimeout,
    AnimationDuration; KeepOpenWhileActive resets the auto-close on interaction so
    a complex interaction holds the cover open.
  • StylingOverlayColor (sanitized), OverlayCssClass, OverlayTemplate,
    CssUrl.
  • Accessible — guard is a keyboard-operable role="button" (Enter/Space),
    content is inert while closed (with a no-inert fallback), focus management,
    aria-expanded, reduced-motion support.

Files

  • Control: TSafetyCover.php, TSafetyCoverEffect.php, TSafetyCoverDirection.php
  • Client: source/prado/controls/safetycover.js, assets/safetycover.css
  • Registered in classes.php and packages.php.

Tests

  • Unit: tests/unit/Web/UI/WebControls/TSafetyCoverTest.php
  • vitest: tests/js/controls/safetycover.test.js
  • Playwright: main, direction×fade matrix, accessibility, keep-open specs

Full check suite green (php-cs-fixer, phpstan, phpunit, vitest, Playwright).

@belisoful
belisoful marked this pull request as ready for review August 28, 2026 23:30
@belisoful
belisoful marked this pull request as draft August 28, 2026 23:31
Adds ResetDelay cooldown after it closes, default 0.
@belisoful
belisoful marked this pull request as ready for review August 29, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant