Skip to contents

Removes focus from the current scope's element, or at the root context from whatever element currently has focus (document .activeElement). A no-op when the body is focused. Useful to clear focus rings before a screenshot.

Usage

pz_act_blur(ctx, ...)

Arguments

ctx

A paparazzi context.

...

Checked empty; reserved for future use.

Value

ctx, invisibly.

Acting on the page

The pz_act_*() functions use the page the way a person would. They send real browser input, such as pointer moves, clicks and key presses, or use the browser's own focus and text-selection methods. They never set a form value directly.

An action with a target looks for it in the current scope and waits until it matches an element. Inside a scope, target = NULL acts on the scope's element, and scrolling with by or to scrolls the scope's container. An explicit target is scrolled into view first when needed. A few actions, like pz_act_press(), take no target and act on the focused element instead.

While the page is recording, actions are staged as pz_stage() sets them up: the cursor glides to pointer targets, typing is paced, scrolls normally use the mouse wheel, and the page holds for the staged pause afterward. Without a recording, actions go straight to their final state.

To set a value directly instead, without staging, use pz_set_value(), pz_set_files(), or pz_set_shiny_input().

See also

Examples

if (FALSE) { # paparazzi:::examples_run()
page <- pz_open(pz_example("tasks"))
page |> pz_act_focus("#task-title")

# Remove the focus ring, e.g. before a screenshot
page |> pz_act_blur()
pz_expect_focused(page, target = "#task-title", not = TRUE)
pz_close(page)
}