altinn-studio icon indicating copy to clipboard operation
altinn-studio copied to clipboard

Not able to name component in group

Open Ildest opened this issue 10 months ago • 2 comments

Description of the bug

When I drag in a second Kort svar component into a group, I am not able give it a name. Instead, it copies my attempted name into "Beskrivelse" and nothing happens when I click outside to save. I have tried deleting the component and trying again. I have also tried uploading changes and tried again. I have also tried to place the new Kort svar above or below the first Kort svar, but there is noe difference, the error is till there.

If I drag in another type of component, for example Langt svar, I can name that without problems.

Steps To Reproduce

  1. Go to Lage.
  2. Create a Group component.
  3. Drag in a Kort svar, name it and save.
  4. Drag in another Kort svar and try to name it. Observe if you get a name or if the name you type is either deleted in the Tekst field or copied to Beskrivelse.
  5. Observe that the component does not get an ID, even if you have connected a data model.
  6. Try to drag in a different type of component and name it, that should work.

Additional Information

image

image

Ildest avatar Apr 17 '24 10:04 Ildest

Good catch! Tested this now, and have some more details to add. Was able to replicate the bug when I drag in a new component (or just switch to an existing empty/new component) without closing the text editor boxes. Looks like the text ID is generated when we click on f.ex. "Ledetekst" button, and when switching to a different component that does not have those texts, this is not triggered. This does not seem to be limited to only within the group component, it appears to be a general issue.

Workaround for this particular case is to close the text edit boxes (click on the blue X) in the affected component, and then add that particular text again.

However this is definitely an issue that should be fixed. The UI makes it appear that is is possible to add the text directly when switching to a new component, when that is actually not the case. If the user changes component, the "open" state of the text edit boxes should probably be reset, so the user never ends up in this situation. Dragging in a new component of a different type does seem to trigger this kind of reset. However, if there are already different components present that have no texts or different texts, just switching between components triggers the same issue - the text edit boxes that were open for the previous component remain open, and where there were not texts previously it appears that you can add a text, when that in fact does not work.

nkylstad avatar Apr 17 '24 11:04 nkylstad

Perfect that someone with more experience than a newbie was able to detect the error and add more detail @nkylstad :-). For a beginner to Altinn Studio, like me, this might lead to frustration, because it is not evident that clicking the blue x is a workaround that will solve the problem.

Ildest avatar Apr 17 '24 12:04 Ildest

Tested OK in dev!

nkylstad avatar May 07 '24 11:05 nkylstad