Artemis icon indicating copy to clipboard operation
Artemis copied to clipboard

`Programming exercises`: Fix re-rendering of collapsed instructions component

Open daniels98it opened this issue 3 years ago • 3 comments

Checklist

General

  • [x] This is a small issue that I tested locally and was confirmed by another developer on a test server.

Motivation and Context

It has been noticed that by collapsing and re-expanding the problem statement card in the online editor view, this re-renders differently and moves all testcases to the bottom of the card. (see recording below)

This has been experienced with Chrome and Edge based browsers.

Description

The reason why this happens seems to be related to the *ngIf directive, re-rendering the problem statement when expanded. By replacing this with the [hidden] attribute, this isn't re-rendered anymore as it remains in the DOM.

Steps for Testing

Prerequisites:

  • 1 Students
  • 1 Programming Exercise
  1. Log in to Artemis
  2. Participate to a programming exercise and open it in the online code editor
  3. Collapse and expand the problem statement on the right
  4. Check that the problem statement rendering is showed properly

Review Progress

Code Review

  • [ ] Review 1
  • [ ] Review 2

Manual Tests

  • [ ] Test 1
  • [ ] Test 2

Test Coverage

Class/File Branch Line

Screenshots

issue_ps

daniels98it avatar Sep 08 '22 10:09 daniels98it

I suggest using *ngIf: https://stackoverflow.com/questions/43034758/what-is-the-difference-between-ngif-and-hidden

ngIf is currently used but leads to the re-rendering issue described above.. I couldn't find an alternative solution or reason why this actually happens.. [hidden] on the other hand keeps the rendering consistent..

daniels98it avatar Sep 08 '22 10:09 daniels98it

Yes :D I should have read the description first :P

Dominik-Weinzierl avatar Sep 08 '22 10:09 Dominik-Weinzierl

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

github-actions[bot] avatar Sep 16 '22 12:09 github-actions[bot]

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

github-actions[bot] avatar Oct 19 '22 12:10 github-actions[bot]