Skip to content

Commit 024cb97

Browse files
kayjoostenphavekes
authored andcommitted
fix: hide QR code container via inline style, not CSS
If applied, this commit will keep the QR code hidden until the authentication/registration JS explicitly reveals it, without the image becoming permanently invisible afterwards. Why is this change needed? Prior to this change, the QR image was hidden with a static `display: none` CSS rule on `.qr img`. SlideableComponent.show() reveals the page by sliding the `.qr`/`#qr` container down and then stripping the inline styles jQuery added during the animation, but it never touches the image's own display value. Once the CSS rule hid the image, nothing ever set it back to visible, so the QR code disappeared for good after the first show/hide cycle. How does it address the issue? This change reverts the CSS change and instead hides the `.qr`/`#qr` container itself with an inline `style="display: none;"`, matching the existing pattern already used for `#open-in-app` in the same templates. Inline styles are fully replaced during the slide animation and removed afterwards, so there is no leftover CSS rule to re-hide the element on subsequent cycles.
1 parent ced205d commit 024cb97

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

assets/scss/application.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ div.middle {
138138

139139
.qr {
140140
img {
141-
display: none;
141+
display: block;
142142
margin-left: auto;
143143
margin-right: auto;
144144
cursor: none;

templates/default/authentication.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<br /><br />
5353
</div>
5454

55-
<div id="qr" class="content-container qr">
55+
<div id="qr" class="content-container qr" style="display: none;">
5656
{{ 'login.qr.instruction' | trans }}
5757

5858
<a href={{ authenticateUrl }}>

templates/default/registration.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<a href="{{ path('app_identity_registration') }}">{{ 'enrol.retry' | trans }}</a>.
5252
</div>
5353
</div>
54-
<div class="content-container qr">
54+
<div class="content-container qr" style="display: none;">
5555
<a href="{{ metadataUrl }}">
5656
<img src="{{ url('app_identity_registration_qr', {'enrollmentKey': enrollmentKey}) }}">
5757
</a>

0 commit comments

Comments
 (0)