Hi Cezary,
There is no direct API to achieve your requirement. As a workaround, you can select the text tab by taking tab object from element, since it’s an EJ2 tab component.
Selection change event will trigger whenever there is a selection in editor.
In that event, you can check whether current context type is table, if so, you can get the tab object and select the text tab using EJ2 tab component API.
Code snippet
onSelectionChange(): void {
var propertyPaneTab = document.querySelector(".e-de-prop-pane>.e-de-property-tab");
if(this.container.documentEditor.selection.contextType.indexOf("Table") >= 0 && propertyPaneTab){
(propertyPaneTab as any).ej2_instances[0].selectedItem = 1;
}
}
|
For your reference, we have prepared the sample. Kindly check it.
But, due to this there will be some changes in the current tab behavior which I mentioned in the previous update. In the above sample, whenever the current selection is within table, text tab will be shown as default. Hence if you select the whole table or row or cell, then text tab will be in default, instead of table tab. Once if you switch to table tab and apply table properties, it will switch to text tab based on current selection. Kindly check whether this satisfy your need.
Please find the video of above mentioned behavior from below link.
Regards,
Harini C