Giter Club home page Giter Club logo

Comments (10)

vjpr avatar vjpr commented on May 31, 2024

After some investigation it seems to be related to this bug in Chrome -> Child elements of tags not always rendered.

Children of noscript are rendered as string literals.

Workaround

Change noscript in PopupContainer to:

return <div style={{display: none}}>{children}</div>;

I'm using Chrome Version 44.0.2396.0 canary (64-bit).

from react-leaflet.

Frikki avatar Frikki commented on May 31, 2024

Apparently, @PaulLeCam is not in favor of changing it to a DIV element. See discussion here #18

from react-leaflet.

PaulLeCam avatar PaulLeCam commented on May 31, 2024

Hi,

Removing a Popup is not supported, you need to update the entire layer, see #18 (comment)

from react-leaflet.

vjpr avatar vjpr commented on May 31, 2024

Hi Paul,

You might have misread the issue. It's not about removing a Popup.

There is a bug in Chrome which is causing this where noscript children are turning into string literals. Not sure how you want to handle this but a div is a simple fix. Otherwise people trying your library will struggle to get a simple example working.

from react-leaflet.

PaulLeCam avatar PaulLeCam commented on May 31, 2024

Sorry I misread about the Popup deletion.

I'm not so up for using a <div> as a workaround because the rendering is made by Leaflet, not React, so the null/<noscript> rendered by the components are only there because React needs to render something.
My main concern is that rendering <div>s could affect the expected layout, but display: none should avoid that issue, I'll try that!

from react-leaflet.

Frikki avatar Frikki commented on May 31, 2024

Please let the style be a React.Component.prop so we have some chance
of overriding it.

On 05/11/2015 02:39 PM, Paul Le Cam wrote:

Sorry I misread about the Popup deletion.

I'm not so up for using a |

| as a workaround because the
rendering is made by Leaflet, not React, so the |null|/||
rendered by the components are only there because React needs to
render something.
My main concern is that rendering |
|s could affect the expected
layout, but |display: none| should avoid that issue, I'll try that!

ā€”
Reply to this email directly or view it on GitHub
#27 (comment).

from react-leaflet.

troutowicz avatar troutowicz commented on May 31, 2024

@Frikki, I will try later tonight but I'm pretty sure that is already possible... while definitely limited due to Leaflet handling the rendering.

<Popup maxWidth='300' minWidth='300' >
  some text
</Popup>

https://github.com/PaulLeCam/react-leaflet/blob/master/src/Popup.js#L40
https://github.com/Leaflet/Leaflet/blob/master/src/layer/Popup.js#L11

from react-leaflet.

PaulLeCam avatar PaulLeCam commented on May 31, 2024

The style would only apply to the PopupContainer component, that should be invisible anyways, not the Popup that would be rendered by Leaflet.

from react-leaflet.

troutowicz avatar troutowicz commented on May 31, 2024

Hmm, I would think those props would be getting passed through the bindPopup method which would be used in Leaflet when creating the popup element. I may submit a PR to Leaflet eventually that would allow passing more styling to popups. Wouldn't be a big change, just create a styling option, and make their popup module aware of it.

L.popup({ style: { ... } });
popupContainer.bindPopup(content, { style: {...} });

from react-leaflet.

PaulLeCam avatar PaulLeCam commented on May 31, 2024

It should work properly now in v0.6 using a div with display: none, I didn't find any issue using it.
Please reopen if the bug appears again after updating.

from react-leaflet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.