Hello, I updated to the latest the syncfusion libraries, and the styles of my icons stop working. The version of buttons is 19.3.53.
The problem appear after update, it was working fine. When I hit reload in a page of the project the styles of the button are not applied, in the devtools I cannot see them applied to the buttons, and the span for the icon also is not there. (Picture 1).
When I navigate to another url and come back the style sheets are there (Picture 2)
Why is that? What change between versions?
I attached the pictures.
I downgraded to 19.2.47 and works fine.
"@syncfusion/ej2-angular-buttons": "19.2.47",
|
<button
ejs-button
cssClass="e-flat"
[isToggle]="true"
[isPrimary]="true"
iconCss="e-btn-sb-icons e-play-icon"
></button>
<button
ejs-button
cssClass="e-flat"
iconCss="e-btn-sb-icons e-open-icon"
[isPrimary]="true"
iconPosition="Right"
></button>
<button
ejs-button
cssClass="e-flat"
iconCss="e-icons e-edit-icon"
[isPrimary]="true"
iconPosition="Right"
></button>
|
Sorry, I cannot shared company code. And don't have the time the try an example.
Could be angular dependencies, we are using angular 11.2.13. Last version of syncfusion support angular 11?
|
"dependencies": {
"tslib": "2.3.0",
"zone.js": "0.11.4",
"@angular/forms": "11.2.13",
"@angular/common": "11.2.13",
"@angular/router": "11.2.13",
"@angular/compiler": "11.2.13",
"@angular/animations": "11.2.13",
"@angular/platform-browser": "11.2.13",
"@angular/platform-browser-dynamic": "11.2.13",
} |
Hello, I updated the base angular package to the latest (19.3.59) and now the buttons are working correctly.
I found this in the updates references, maybe this was the problem:
Common
F170730 - Resolved Button component not properly rendered while using ncstate popover third party.The problem is that the <span> inside the button tag is not created correctly (maybe when IconCss property is set). Also this problem still persist in the dropdown buttons. I manage to create an angular directive to solve the problem:
@Directive({
selector: '[ejs-dropdownbutton]',
})
export class EjsDropdownButtonFixerDirective implements AfterViewInit {
constructor(@Host() private ejsButton: DropDownButtonComponent, private renderer: Renderer2) {}
ngAfterViewInit(): void {
setTimeout(() => renderButton(this.ejsButton, this.renderer, true), 100);
}
}
export const renderButton = (ejsButton: ButtonComponent | DropDownButtonComponent, renderer: Renderer2, isDropDown = false): void => {
let toReRender = false;
const cssClass = ejsButton.cssClass;
const hasSpan = !!ejsButton.element.getElementsByTagName('span')[0];
if (!hasSpan) {
renderer.addClass(ejsButton.element, 'e-btn');
ejsButton.cssClass = cssClass;
toReRender = true;
if (ejsButton.iconCss) {
renderer.addClass(ejsButton.element, 'e-icon-btn');
}
}
if (toReRender) {
ejsButton.render();
if (isDropDown) {
const spanElement = ejsButton.element.getElementsByTagName('span')[1];
if (spanElement) renderer.removeChild(ejsButton.element, spanElement);
}
}
};
I hope this helps to improve the dropdown buttons.