#dom 5 articles
- behavior: 'smooth' is silently ignored inside a portaled overlaygotchas / spfxJump-to-section does nothing in a modal/reader; drop the flag and set scrollTop directly
- window.scrollTo does nothing in an SPFx web part on a modern pagegotchas / spfxThe page scrolls inside a canvas element, not the window; switching views in a single-page web part leaves the user mid-page. Find the real scrolling ancestor and reset that
- A textarea jumps after you change its text from code and restore the selectiongotchas / spfxfocus() scrolls the page to the element and, in Chromium, setSelectionRange scrolls the textarea to the end of the selection; restore the selection with focus({ preventScroll }) and put scrollTop back
- Injecting your own column into the modern list grid — rows are display:contents, cells carry explicit grid placementgotchas / spfxAn appended cell lands in the wrong row and shifts the table; rows are display: contents, so the cells are the grid items and every one carries explicit grid-column/grid-row
- Reading the modern list selection from the DOM — names only, and the count liesgotchas / spfxOnly a ListViewCommandSet gets selectedRows; from the DOM take names only (the name is a button, not a link), resolve paths with one folder-scoped call, and take the real count from clearSelectionCommand because the…