-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fixed selected component #14315
base: main
Are you sure you want to change the base?
fix: fixed selected component #14315
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14315 +/- ##
=======================================
Coverage 95.57% 95.57%
=======================================
Files 1841 1841
Lines 23880 23882 +2
Branches 2755 2756 +1
=======================================
+ Hits 22823 22825 +2
Misses 800 800
Partials 257 257 ☔ View full report in Codecov by Sentry. |
const getSelectedComponentId = components.find( | ||
(comp) => comp.textResourceBindings?.title === tableColumn.headerContent, | ||
)?.id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was initially thinking along the same lines as you to identify the component. However, as @mlqn pointed out for me earlier, using the title has some potential flaws—for example, if multiple components share the same title. Additionally, the new feature from #13980, which allows users to customize the table column title (tableColumn.headerContent
), will break this logic since it separates the column title from the component's title. Given this, we might need a different approach to ensure correct component identification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used id
instead of title
, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a better approach I think, however I don't think componentId
is supported in the app. As you can see in the preview below. If there are not other approaches or props to be used here to identify, perhaps you could contact team apps in altinn-studio
-channel and describe them this problem for studio whereas if they can allow a prop such as componentId to be set in the tableColumns
.
…mponent-does-not-remain-selected
…mponent-does-not-remain-selected
Description
Related Issue(s)
Solution After:
Screen.Recording.2024-12-19.at.10.55.01.mov
Verification
Documentation