Skip to content

Commit

Permalink
fix(ui): properly position help icon for tooltips next to form fields (
Browse files Browse the repository at this point in the history
…#1511)

Co-authored-by: Simon <simon@aam-digital.com>
  • Loading branch information
sleidig and TheSlimvReal authored Nov 3, 2022
1 parent 4366ff9 commit fae1596
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/app/core/config/config-fix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,8 @@ export const defaultJsonConfig = {
"name": "motherTongue",
"schema": {
dataType: "string",
label: $localize`:Label for the mother tongue of a child:Mother Tongue`
label: $localize`:Label for the mother tongue of a child:Mother Tongue`,
description: $localize`:Tooltip description for the mother tongue of a child:The primary language spoken at home`,
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,25 @@
<form class="columns-wrapper">
<div *ngFor="let col of _columns; let i=index" class="column-group">
<h2 *ngIf="columnHeaders && columnHeaders[i]">{{columnHeaders[i]}}</h2>
<div
*ngFor="let row of col"
[appDynamicComponent]="{
component: row.edit,
config: {
formFieldConfig: row,
propertySchema: entity.getSchema().get(row.id),
formControl: form.get(row.id)
}
}"
>
<div *ngFor="let row of col">
<div [class.field-with-tooltip-suffix]="row.tooltip">
<ng-container [appDynamicComponent]="{
component: row.edit,
config: {
formFieldConfig: row,
propertySchema: entity.getSchema().get(row.id),
formControl: form.get(row.id)
}
}"></ng-container>
</div>
<fa-icon
(click)="tooltipElement.show()"
#tooltipElement="matTooltip"
*ngIf="row.tooltip"
matSuffix
icon="question-circle"
[matTooltip]="row.tooltip"
class="tooltip-suffix"
></fa-icon>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,12 @@ $max-screen-width: $min-block-width + $margin-main-view-right + $margin-main-vie
margin-bottom: 20px !important;
font-family: sans-serif;
}

.field-with-tooltip-suffix {
width: calc(100% - 24px);
display: inline-block;
}

.tooltip-suffix {
margin: 4px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const cols = [
{
id: "projectNumber",
edit: "EditNumber",
tooltip: "some extra explanation",
},
{
edit: "EditLongText",
Expand Down

0 comments on commit fae1596

Please sign in to comment.