Removed usage of withStyles
in Dialog
component
#236
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Removed usage of
withStyles
inDialog
component in order to avoid conflicts withwebviz-subsurface-components
.Both packages use
MaterialUI v4
which again usesjss
under the hood with itsmakeStyles
/withStyles
functions.jss
automatically addsstyle
nodes to the DOM containing CSS with auto-generated class names (e.g.jss1
,jss2
etc.). However, since both packages did make use of themakeStyles
function and bothjss
instances did not know of one another (andjss
does not check for duplicates in the DOM when generating class names), class naming conflicts occured (e.g. the first dynamically created class inwcc
would have the same name as the first inwsc
-jss1
). This lead to thejss1
class inwcc
being applied to all elements inwsc
with the same class name (and vice versa) and, hence, preventingpointer-events
(since the only class added withjss
inwcc
was one preventing the background of the dialog accepting pointer-events in order to make the plugin behind the dialog remain clickable/usable when no backdrop was set).This issue is temporarily fixed by removing the usage of
withStyles
in theDialog
component. However, the problem itself remains and might lead to further bugs that are difficult to debug. A general solution to this issue might be to upgrade toMaterialUI v5
which no longer usesjss
butemotion
. However, it is unknown ifemotion
has an implementation for checking for duplicates and works better thanjss
.