ngSemantic
ngSemantic copied to clipboard
Tooltip does not update
A tooltip does not update when the directive's smDirTooltip attribute changes.
Perhaps the directive could use ngOnChanges to update the data-tooltip attribute?
For anyone experiencing the same problem: I found a solution by using attr.data-tooltip=""
instead. This works when the tooltip needs to reflect dynamic changes
@flemeur I believe your solution would defeat the purpose of the directive itself, if you set the data properties directly.
I would image that having the smDirTooltip and smDirPosition as setters instead of class properties would be a good solution to this problem. For instance:
@Input()
set smDirTooltip(toolTip: string) {
this.element.element.nativeElement.setAttribute("data-tooltip", toolTip);
}
@Input()
set smDirPosition(position: string) {
this.element.element.nativeElement.setAttribute("data-position", position);
}
And you could have some extra logic for defaults much like is already in the code. Just a suggestion.
@tspayne87 That would definitely be a good solution. I only mentioned my temporary "solution" because others might find it useful, until a proper fix is implemented :)