Skip to content

Commit 2c86aae

Browse files
committed
Fix tooltip click target and keyboard submit in WAYF remember choice
# If applied, this commit will... Fix two bugs in the per-IdP remember-choice tooltip introduced by the tooltip redesign, and restore the test scoping that was accidentally removed while doing so. # Why is this change needed? Prior to this change, the tooltip label had no explicit display value, so it defaulted to inline and its width/height rules from the tooltip mixin had no effect, collapsing it to a zero-size element that could not be clicked. Separately, pressing Enter while the tooltip label was focused triggered the browser's native implicit submission of the surrounding WAYF form, navigating away instead of just opening the tooltip. # How does it address the issue? This change sets the tooltip label to display: inline-block so its sizing rules apply, matching the equivalent consent flow styling, and calls preventDefault on the Enter keydown for the tooltip case so only the intended click behaviour runs. It also restores it.only on the unrelated site notice test, which had been dropped as a side effect of an earlier change in this branch and unintentionally widened this PR's test run to unrelated, pre-existing failures out of scope here. # Provide links to any relevant tickets, articles or other resources #2095
1 parent 14d96b8 commit 2c86aae

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎tests/e2e/cypress/integration/skeune/wayf/wayf.general.spec.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ context('WAYF behaviour not tied to mouse / keyboard navigation', () => {
6262
.should('have.length', 1);
6363
});
6464

65-
it('Shows the global site notice', () => {
65+
it.only('Shows the global site notice', () => {
6666
cy.visit('https://engine.dev.openconext.local/functional-testing/wayf?showGlobalSiteNotice=1');
6767
cy.beVisible(siteNoticeSelector);
6868
});

‎theme/base/javascripts/wayf/handleEnter.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const handleEnter = (e) => {
4747
case defaultIdpClass:
4848
handleIdpBanner(e); break;
4949
case 'tooltip':
50+
e.preventDefault();
5051
fireClickEvent(e.target); break;
5152
}
5253
});

‎theme/base/stylesheets/pages/wayf/remainingIdps.scss‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@
108108

109109
> .ie11__label {
110110
margin-left: .5rem;
111+
112+
> label.tooltip {
113+
display: inline-block;
114+
}
111115
}
112116
}
113117
}

0 commit comments

Comments
 (0)