We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Select Toolbar Item

How do I set the a toolbar item as active (and selected) by default programmatically?

1 Reply

RM Ruksar Moosa Sait Syncfusion Team November 2, 2022 04:38 AM

Hi Addy,

You can select or make the toolbar item active by setting focus to the respective toolbar item like the below code.

let toolbarItem = document.querySelectorAll('.e-toolbar-item');
let focusbuttonButton = new Button();


    focusbutton.element.onclick = (): void => {

        (toolbarItem[0].firstChild as HTMLElement).focus();


Sample: https://stackblitz.com/edit/beytfz-2ngite?file=index.ts,index.html


Graphical user interface, application

Description automatically generated


Ruksar Moosa Sait

Live Chat Icon For mobile
Up arrow icon