Any time a template or parameter receives user events, it should be highlighted in both the sidebar and content, and if necessary the page should scroll to make it visible.
**Acceptance criteria**
Syncing from left to right:
|** action on the left **| results in the **content pane**
| ----- | -----
| **select a parameter** (press **space**) | [x] scroll into view [x] focus stays in sidebar T296996
| **select** a **template or wikitext** transclusion (press **space**) | [x] scroll into view [x] focus stays in sidebar
| **cursor keys** (up and down) | [x] no scrolling [x] no focus
| **unselect a selected parameter** (space or checkbox click) that was **selected** | [x] selection goes away [] focus stays as is T296996, T312213 [x] no scrolling
| **unselect a parameter** (space or checkbox click) that was **not selected** | [x] should just be removed [x] focus stays as is T296996 [x] no scrolling
| press the **delete button** in the toolbar to delete a template or wikitext transclusion | [x] selection jumps to following element (template or wikitext), except if there is no element below, [] then jump to previous part (see T312221)
Different effects in desktop and mobile
|** action on the left **| results in the **desktop skin** | results in the **mobile skin** | results in **narrow mode** T290975
| ----- | ----- | ----- | -----
| press **enter** or mouse **click on** a **template name** in the sidebar | [x] scroll into view [x] focus moves to link in description | [x] scroll into view [x] focus stays see T291080 | after view flip: [x] scroll into view
| press **enter** or mouse **click on** a **wikitext item** in the sidebar | [x] scroll into view [x] focus moves to input field | [x] scroll into view [x] focus stays see T291080 | after view flip: [x] scroll into view
| press **enter** or mouse **click on** a **parameter** in the sidebar | [x] scroll into view [x] focus moves to input field | [x] scroll into view [x] focus stays see T291080 |after view flip: [x] scroll into view
| press **space** to **select a parameter** | [x] scroll into view [x] focus stays in sidebar T296996 | [x] scroll into view [x] focus stays in sidebar T296996 | -
| press **space** or **click the checkbox** to **unselect a parameter** and it **is selected** | [x] selection goes away [] focus stays as is T296996, T312213 [x] no scrolling | [x] same as desktop | [x] same as desktop
| press **space** or **click the checkbox** to **unselect a parameter** and it **is not selected** | [x] should just be removed [x] focus stays as is T296996 [x] no scrolling | [x] same as desktop | [x] same as desktop
| **cursor keys** (up and down) | [x] no scrolling [x] no focus | [x] no scrolling [x] no focus | -
| click **new template** or **new wikitext** button | [x] focus on input | [x] focus on input T291067 | after view flip (see also T291365):| after view flip: [x] scroll into view
| press **space** to select a template or wikitext transclusionenter** or mouse **click on** a **parameter** in the sidebar | [x] scroll into view [x] focus stays in side barmoves to input field | [x] scroll into view [x] focus stays in side bar | |after view flip: [x] scroll into view (see also T290975)
| press the delete button in the toolbar to delete a template or wikitext transclusion | [x] selection jumps to following element (template or wikitext), except if there is no element below, [] then jump to previous part (see T312221) | [] same as desktop | [] same as desktopclick **new template** or **new wikitext** button | [x] focus on input | [x] focus on input | after view flip (see also T291365): [x] scroll into view
Syncing from right to left:
| **action in the right sidebar **| results in the **desktop skin** | results in the **mobile skin** | results in **narrow mode** |
| ----- | ----- | ----- | -----
| focus an **input element** | [x] scroll into view [x] highlighted T311204 | [x] scroll into view [x] highlighted T311204 | after view flip: [x] scroll into view [x] highlighted |
| focus a **wikitext input** | [x] scroll into view T291381 [x] highlighted | [x] scroll into view T291381 [x] highlighted | after view flip: [ ] scroll into view [x] highlighted
[x] Disable the bogus auto-scroll feature described in T289043#7297679.
**Dev notes**
This partly depends on the keyboard navigation work in {T285323}, which will refactor events. We'll probably need to disconnect old sidebar events, either by preventing it from being created, or by putting conditionals around code that connects its event handlers.