blazorbootstrap icon indicating copy to clipboard operation
blazorbootstrap copied to clipboard

Tabs: Tab navigation events should pass the tab name property instead of title

Open tjdennis opened this issue 3 months ago • 1 comments

Hi,

I'm trying to use the OnShown() event on the Tabs component but the event arguments are providing the tab's Title property instead of the tab's Name property.

The two problems with the title are :

  • The event TabsEventArgs properties are null if you use a TitleTemplate sub-component.
  • The Title property is usually localized to the user's language so trying to perform logic on the value may not work.

You have a Name property on each Tab which you do use when calling the ShowTabByNameAsync() method to identify them in code. This should also be the names passed to the event arguments in TabsEventArgs.

I'm not sure if changing this will break other people's code, so maybe adding new ActiveTabName and PreviousActiveTabName properties could be added to the TabsEventArgs class.

Thanks!

tjdennis avatar Mar 13 '24 17:03 tjdennis

@tjdennis Thank you for your valuable feedback. We will incorporate it in the upcoming release.

gvreddy04 avatar Mar 13 '24 17:03 gvreddy04