BaseDialog 'isBlocking' IDialogConfiguration override is not working.
Category
- [ ] Question
- [ ] Typo
- [X] Bug
- [ ] Additional article idea
Expected or Desired Behavior
The opened dialog shouldn't close when clicked outside the dialog when isBlocking = true
Observed Behavior
The opened dialog closes.
Steps to Reproduce
- Follow the steps to create a dialog as here - https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/guidance/using-custom-dialogs-with-spfx.
- Override the getconfig() method in the basedialog as below public getConfig(): IDialogConfiguration { return { isBlocking: true }; }
- The sp-dialog version I have is "@microsoft/sp-dialog": "~1.3.4"
@AsishP - thank you for your feedback. This looks like an issue that we will investigate.
Hi @AsishP,
This is an error in documentation. The configuration should be passed in as constructor parameter. This gives the developer more flexibility.
If you want the color picker to be configurable by instance, pass the config on instantiation:
const dialog: ColorPickerDialog = new ColorPickerDialog({isBlocking: true});
If you want the color picker to always be blocking, pass the config to its base class in the constructor:
constructor() {
super({isBlocking: true});
}
You can check the API reference here: https://docs.microsoft.com/en-us/javascript/api/sp-dialog/basedialog
Thanks for pointing out the error. I will make sure the documentation is fixed.
Thanks @moyali. Sorry for a delayed reply. Finally got a chance to test it today.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues