microsoft / vsts-extension-multivalue-control

A work item form control which allows selection of multiple values.
MIT License
47 stars 45 forks source link

Dropdown disappears on workitem refresh in Microsoft Edge #81

Closed maxxwizard closed 5 years ago

maxxwizard commented 5 years ago

Repro steps:

  1. Create a bug.
  2. Switch to History tab and click the refresh icon.
  3. Switch back to Details tab and notice the multivalue control is not rendering properly. You can hover over it to see the help tool tip but cannot edit the dropdown.

Issue only reproduces in Edge, not Chrome.

Edge Microsoft Edge 42.17134.1.0 Microsoft EdgeHTML 17.17134

Chrome Version 70.0.3538.102 (Official Build) (64-bit)

mmanela commented 5 years ago

@maxxwizard Can you share a screenshot? @ostreifel can you take a look

maxxwizard commented 5 years ago

before image

after image

aDavidaIsNoOne commented 5 years ago

Can also confirm the bug in Firefox 64.0b9 (64-bit).

I noticed there's no listener for the the onRefreshed event. Technically this should be occurring in Chrome as well, which implies inconsistent event behavior across browsers.

    return {
        onLoaded: (args: WitExtensionContracts.IWorkItemLoadedArgs) => {
            ensureControl();
        },
        onFieldChanged: (args: WitExtensionContracts.IWorkItemFieldChangedArgs) => {
            if (control && args.changedFields[control.fieldName] !== undefined &&
                args.changedFields[control.fieldName] !== null
            ) {
                control.refresh();
            }
        },
};
aDavidaIsNoOne commented 5 years ago

I was incorrect in my assumption, it actually turned out to be the resize method. FF and Edge were reporting a scrollWidth and scrollHeight of 0 when refreshing from another tab.

private _resize = () => {
        VSS.resize(this._container.scrollWidth || 200, this._container.scrollHeight || 40);
}