Member Junction
    Preparing search index...
    • The tool the host should hold when current is no longer allowed: select when the roster offers it, else the roster's first KNOWN entry, else select as the floor.

      Why select first rather than roster[0]: roster order is documented as meaningless for rendering (VisibleToolbarEntries always uses list order), so it must not quietly become load-bearing here. select is the neutral tool; falling back to roster order instead would let a host land the user on the eraser by writing the roster in an innocuous order.

      An empty or all-typo roster ALSO lands on select, rather than leaving current alone. The board never has "no tool", so something has to be held, and holding the tool the roster just revoked is the one answer that keeps a creating tool live with no toolbar to see it and no key to change it — an empty roster used to keep placing widgets. select is always a real tool and can create nothing, so it is the safe floor. Narrowing the palette to nothing still does NOT make the board read-only; that is ReadOnly.

      Parameters

      • current:
            | "sticky"
            | "shape"
            | "text"
            | "image"
            | "connector"
            | "markdown"
            | "html"
            | "select"
            | "pan"
            | "pen"
            | "eraser"
      • roster: readonly (
            | "sticky"
            | "shape"
            | "text"
            | "image"
            | "connector"
            | "markdown"
            | "html"
            | "select"
            | "pan"
            | "pen"
            | "eraser"
        )[]

      Returns
          | "sticky"
          | "shape"
          | "text"
          | "image"
          | "connector"
          | "markdown"
          | "html"
          | "select"
          | "pan"
          | "pen"
          | "eraser"