OneScript

EditButton

Toggle edit mode for the current navigation stack.

EditButton shows the system Edit / Done button and toggles edit mode. On iOS, a List with multiple selection only lets the user check rows in edit mode. It is usually placed in a toolbar.

import { EditButton, List, Modifier, ToolbarItem } from "onescript/views"

<List
  selection={selected}
  onSelectionChange={setSelected}
  modifier={Modifier.toolbar(<ToolbarItem placement="primaryAction"><EditButton /></ToolbarItem>)}
>
  {rows}
</List>

EditButton takes no props other than Modifiers. It is only available in App and Action view sessions; widgets reject it with an unsupported view type error.

How is this guide?

Last updated on