# `Events['material:selected']`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

Property of [`Events`](Events.md) · stable · since 2.0.0

```ts
'material:selected': {
  readonly cause: Cause;
  readonly group: string;
  readonly material: string;
};
```

A global-material GroupNode's selection changed in a commit: `material` (a MaterialNode
`nodeId`) is now selected in `group`. Fires for [`select()`](Writer.select.md), undo, redo, [`applyPatch`](Writer.applyPatch.md),
[`setSceneModel`](Writer.setSceneModel.md), a restore or a reload alike; `cause.kind` tells which. One event per changed
group; a group the commit removed fires nothing.

## Fields

<a id="cause"></a>
### `cause`

```ts
readonly cause: Cause;
```

<a id="group"></a>
### `group`

```ts
readonly group: string;
```

<a id="material"></a>
### `material`

```ts
readonly material: string;
```

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `material:selected` names no product |
| 2. A precedent | pass: [Unity Renderer.sharedMaterial](https://docs.unity3d.com/ScriptReference/Renderer-sharedMaterial.html) (row `K9`) |
| 3. Two apps, or labs | pass: 21 apps (ledger: app-b362a81c85; fleet cross-check: app-04c2774145, app-0c773a4ee3, app-37356bf09f, app-378d190f1b, app-4762caacdc, app-4fd23bc869, app-822bb9d6aa, app-8675b3225c and 13 more) |
| 4. The cheaper fix first | decided per need in Appendix B: rows `K9` at tier app, stable (a member only where no rule, data, asset or app code serves the need) |
