Open arnaud-morvan opened 2 years ago
Hi @dsuren1
What do you think about removing withContainer
from MapStore2:
Because:
container
instead of giving a default valueid
instead of a class
for a modal container (a class, by definition, can match multiple elements, so behavior is not determinist)Because here we also remove handleDialogClick
which may have some useful effect:
But I do not see how to fix this use case without importing directly Modal from react-bootstrap
Or maybe we coult set it as a default value instead of an overwrite to avoid breaking something else.
Cheers
Arnaud
MapStore2 Modal try to set it's container to ".ms2 > div": https://github.com/geosolutions-it/MapStore2/blob/5e4e0f5320550a648cb55994ebeea718d9915fcd/web/client/components/misc/WithContainer.jsx#L16
Note that it does not give a default but overwrite the value given to the constructor !
In MapStore2 this selector does not return any element, so container fallback on "body" as in react-bootstrap: https://react-bootstrap.github.io/react-overlays/api/Modal#container
When using some extensions (GeoNetwork, TJS), which inject tags
<div class="ms2">...
, modal does not appear anymore because those tags have "display: none". IMHO we should always inject modal in body, for a correct backDrop.This fix it by using the standard modal from react-bootstrap.