Deal with focus state following cancelation

Follows pattern from dialogs whereby focus returns
to the button/link that fired the dialog when it
closes.
This commit is contained in:
Tom Byers
2019-02-01 16:13:04 +00:00
parent d633bdbb6d
commit 693ddadbc4
2 changed files with 15 additions and 10 deletions

View File

@@ -1,6 +1,8 @@
// CSS adapted from
// https://github.com/alphagov/govuk_frontend_toolkit/blob/d9489a987086471fe30b4b925a81c12cd198c91d/docs/javascript.md#stick-at-top-when-scrolling
$sticky-padding: $gutter * 2 / 3;
.js-stick-at-top-when-scrolling,
.js-stick-at-bottom-when-scrolling {
@@ -44,11 +46,9 @@
.js-stick-at-bottom-when-scrolling {
$vertical-padding: $gutter * 2 / 3;
transition: bottom 0.1s ease-out, box-shadow 1s ease-in-out;
padding: $vertical-padding 0 $vertical-padding $gutter-half;
margin-top: -$vertical-padding;
padding: $sticky-padding 0 $sticky-padding $gutter-half;
margin-top: -$sticky-padding;
& + .js-stick-at-bottom-when-scrolling {
margin-top: ($sticky-padding * 2) * -1;