Enterprise-ng: ToolbarFlex: Correct the SohoToolbarFlexEvent.item type definition

Created on 9 Jun 2020  路  3Comments  路  Source: infor-design/enterprise-ng

Is your feature request related to a problem? Please describe.
It seems the soho-toolbar-flex typescript definition is not yet updated to include the type for the item property (SohoToolbarFlexSelectedEvent.item). It appears from using Chrome dev tools that it should be ToolbarFlexItem but from the typescript definitions in the library for our code we are getting the type HTMLButtonElement | HTMLAnchorElement | HTMLInputElement

Describe the solution you'd like
Update the typescript definition for SohoToolbarFlexSelectedEvent.item property to be the correct one.

Describe alternatives you've considered
I tried typesetting but this creates a bit more code changes on our app

Additional context
Please consider the code below:

    getSelectedData(event: SohoToolbarFlexSelectedEvent) {
        let dataset;
        if (event.item.type === 'actionbutton' || event.item.type === 'menubutton') {
            // produces linting error here since item property's type is not correct
            dataset = event.item.selectedAnchor[0].dataset;
        } else {
            // produces linting error here since item property's type is not correct
            dataset = event.item.element.dataset;

        }
        return dataset;
    }
[1] type

All 3 comments

Not sure whats correct here 100%. What do you think @EdwardCoyle ? Quick for a PR?

Seems pretty straightforward

This issue is now resolved.

Was this page helpful?
0 / 5 - 0 ratings