Dev Helpers
← Back

Allow an inner panel to scroll even with keyboard focus

Allow an inner panel to scroll even with keyboard focus with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  .demo {
    max-height: 6rem;
    overflow-y: auto;
  }
  .demo:focus-visible {
    outline: 2px solid #1d4ed8;
  }
</style>
<div class="demo" tabindex="0" role="region" aria-label="Release notes">
  <p style="height: 10rem">
    Focus this region and use Page Down or the arrow keys.
  </p>
</div>