sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

BaseDialog 'isBlocking' IDialogConfiguration override is not working.

Open AsishP opened this issue 8 years ago • 4 comments

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

  1. 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.
  2. Override the getconfig() method in the basedialog as below public getConfig(): IDialogConfiguration { return { isBlocking: true }; }
  3. The sp-dialog version I have is "@microsoft/sp-dialog": "~1.3.4"

AsishP avatar Dec 08 '17 00:12 AsishP

@AsishP - thank you for your feedback. This looks like an issue that we will investigate.

GrahamMcMynn avatar Dec 12 '17 17:12 GrahamMcMynn

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.

moyali avatar Jan 17 '18 20:01 moyali

Thanks @moyali. Sorry for a delayed reply. Finally got a chance to test it today.

AsishP avatar Feb 08 '18 10:02 AsishP

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

msft-github-bot avatar Jan 28 '20 18:01 msft-github-bot