Repository navigation
v0.6.10 — a popover is never modal, Return goes on only when nothing answered it, and a click focuses what it lands on
A Popover now behaves the same on every screen: a press outside closes it and goes on
to what was pressed, the page behind stays where a screen reader reaches it, and in the Tab
order it sits right after what opened it. What must be finished before anything else is a
Sheet or a Dialog.
Return from a text field goes on to what holds the field — a dialog's default button, a
row's Save — only when nothing answered it: a field in a Form, or one whose
onEnter says what Return does, has answered it, and a key binding further out no
longer hears it too.
name: TextInput [ accessibilityLabel = "Name", onEnter() { app.rename(this.value) } ]
A press on a view that is focusable = true now gives it the focus, as the guide's own
examples always assumed: click a canvas-like editor, and its key bindings answer.
The flagship calendar is 171.4 KB gzipped at this tag.
Breaking: 2 changes to make — npx declare-changes app.declare lists the ones in your program.
Breaking changes
a Popover was modal on a phone → it is never modal
On a narrow screen a popover used to show as a sheet over a scrim: a press outside only
closed it, and the page behind was out of reach. It still shows as a sheet there, but it is
not modal: a press outside closes it and goes on to what was pressed, as on a desktop.
What must be finished before the person goes on was never a popover's job; it is a sheet's,
modal on every screen.
confirm: Popover [ anchorTo = { app.payButton },
Text [ text = "Pay $40?" ],
Button [ label = "Pay", primary = true, onClick() { app.pay(); app.confirm.close() } ] ]
confirm: Sheet [
Text [ text = "Pay $40?" ],
Button [ label = "Pay", primary = true, onClick() { app.pay(); app.confirm.close() } ] ]
Docs: Popover
Watch for: a popover whose content must be finished, or dismissed on purpose, before the
person goes on — on a phone that was a modal sheet. Make it a Sheet or a Dialog.
Return went on after a field answered it → it goes on only when nothing did
A field's Return used to run its onEnter and then go on through the key bindings around
it, so a field in a form submitted the form and an App's Enter binding ran as well; a
field whose onEnter did its own thing still set off the binding further out. Now the key
goes on only from a field outside a form whose onEnter is the built-in one.
App [ keyBindings = { [ ({ key: "Enter", command: "save" }) ] }, save() { app.store() },
name: TextInput [ onEnter() { app.check(this.value) } ] ]
App [ keyBindings = { [ ({ key: "Enter", command: "save" }) ] }, save() { app.store() },
name: TextInput [ onEnter() { app.check(this.value); app.save() } ] ]
Docs: TextInput.keyBindings
Watch for: an Enter binding on a container that a field with its own onEnter, or a field
in a form, used to set off too — it no longer hears that Return; do both in onEnter. A
Combobox follows the same rule: outside a form, with a choice made, Return goes on.
Smaller changes
- A press on a
focusable = trueview focuses it, once the press is through: a control,
a field or a link that focuses itself keeps that, and a command button keeps the focus
where it was, so its command reaches the focused view. - Tab leaves a
MenuBar's titles for the next control, and Shift-Tab comes back. - A button's menu offers commands for the view the focus is on: a row bound by
something further out is live, not greyed, while the menu is open. - A focused row removed from its list leaves its place: the next Tab goes on from where
it stood. A row deleted from its own confirm dialog hands the focus to the row after it. - A view with a
linknever covers what paints above it: a menu or popover over a link
takes its own clicks. - Escape in an editor inside a grid's or list's cell cancels the edit and leaves the
cell, by the cell group's own default, so an override further in still comes first. Focus.next(past)andFocus.prev(past)are in the type scaffold.declare-verifysays when Tab goes back against reading order — to a control above,
or left of it on the same row — naming both and the fix: declare them in the order they
are read, or say the order in their container'stabOrder(). Overlays and bars held over
the page (ignoreScroll) are their own business.