Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

sp webpart base.baseclientsidewebpart.ondisplaymodechanged

John Nguyen edited this page Apr 22, 2021 · 2 revisions

Home > @microsoft/sp-webpart-base > BaseClientSideWebPart > onDisplayModeChanged

BaseClientSideWebPart.onDisplayModeChanged() method

This event method is called when the display mode of a web part is changed.

Signature:

/** @virtual */
protected onDisplayModeChanged(oldDisplayMode: DisplayMode): void;

Parameters

Parameter Type Description
oldDisplayMode DisplayMode The old display mode.

Returns:

void

Remarks

The default implementation of this API calls the web part render method to re-render the web part with the new display mode. If a web part developer does not want a full re-render to happen on display mode change, they can override this API and perform specific updates to the web part DOM to switch its display mode.

Clone this wiki locally