Modal dialog does not work in SPFx web part

Copper Contributor

Using SPFx with react (hooks) I am developing a web part with few components.

  1. One component should show as a modal dialog but never shows
  2. Another is a tooltip implementation and does not show at all too.

 

Does anyone have a good example? there is one for extensions but did not find one for the web part.

Thank you

5 Replies

@Ofer-Gal 

 

Hi ,

 

Its so hard to say without seeing any code.Have you tried using the Office UI Fabric Dialog and Teaching Bubble for your requirements?

 

 

I tried "Office UI Fabric" Dialog. What is "Teaching Bubble "?
My test was a component using DetailsList example where each row had a button that called a component using Dialog or Panel. nither of them ever showed and the console showed CORS error.

If you have Chrome,can you run chrome using disablewebsecurity which will disable the CORS issues for time being to verify that your content has been working properly or not in a Dialog

 

So you code is failing because of CORS issue,not because of the react component not getting rendered.

 

Teaching bubble is more of a tooltip kind of thing to display.Here is the link.

 

https://developer.microsoft.com/en-us/fabric#/controls/web/teachingbubble

@O365Developer  I am actually using the new edge to test my development.

 

once developed, my users will need to run with disabled web security. :facepalm:

 

@Ofer-Gal 

 

I want you to run with disablewebsecurity in Chrome to make sure that your code is working fine without any issues.

Disabling CORS in IE not possible ,or may be possible with newer version of Edge.

https://superuser.com/questions/1020612/can-the-same-origin-request-policy-be-disabled-in-microsoft-...

 

If the code is running fine, and in order to handle the CORS issue,we can use some proxies like heroku or you can develop your own custom proxy,however that needs to be hosted on some server.