1. Generate bundles in the dist folder.
- gulp package-solution --ship
3. Deploy the application customizer app to the SharePoint site.
4. Refresh the SharePoint site. You will observe the movement of the page (flickering).
How to avoid the movement of the page?
To pre-allocate space, below HostProperties configuration properties can be used:
- preAllocatedApplicationCustomizerTopHeight - Pre-allocated height for the top placeholder
- preAllocatedApplicationCustomizerBottomHeight - Pre-allocated height for the bottom placeholder
Pre-allocation can be defined either in the elements.xml or in the ClientSideInstance.xml files.
Pre-allocation for site scoped deployment
For site scoped deployment, pre-allocation can be defined as HostProperties entry in elements.xml file under sharepoint\assets folder.
- <?xml version="1.0" encoding="utf-8"?>
- <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
- <CustomAction
- Title="PreallocateSpace"
- Location="ClientSideExtension.ApplicationCustomizer"
- ClientSideComponentId="d1a63535-2e2a-4cb9-8e78-f29d4743c396"
- ClientSideComponentProperties="{"Top":"Test message"}"
- HostProperties="{"preAllocatedApplicationCustomizerTopHeight":"50","preAllocatedApplicationCustomizerBottomHeight":"50"}">
- </CustomAction>
- </Elements>
The above configuration will define the default height to 50 pixels.
Pre-allocation for tenant-wide deployment
For tenant-wide deployment, pre-allocation can be defined as HostProperties entry in ClientSideInstance.xml file under sharepoint\assets folder.
- <?xml version="1.0" encoding="utf-8"?>
- <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
- <ClientSideComponentInstance
- Title="PreallocateSpace"
- Location="ClientSideExtension.ApplicationCustomizer"
- ComponentId="d1a63535-2e2a-4cb9-8e78-f29d4743c396"
- Properties="{"Top":"Test message"}"
- HostProperties="{"preAllocatedApplicationCustomizerTopHeight":"50","preAllocatedApplicationCustomizerBottomHeight":"50"}">
- </ClientSideComponentInstance>
- </Elements>
Test the Pre-allocated Space
An application customizer pre-allocates the defined space on the server side as shown below,