GoogleWebComponents / google-map

Google Maps web components

Home Page:https://elements.polymer-project.org/elements/google-map

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docs: google-map-marker "draggable" property not listed in the properties table

eximius313 opened this issue · comments

This is a tough one b/c draggable is a native HTML attribute. I don't think our doc system can pick up properties outside of properties. @garlicnation might know.

commented

but with google-map-marker it has significant meaning.

I'm not disagreeing. Just saying our current doc system doesn't handle this case (I think). It was probably a mistake to use the native property, but one could also argue for it. We're using existing stuff.

Setting draggable="false" on the component does work however, so maybe add this to the documentation in an example?

@ebidel The demo appears to be draggable, so am I misunderstanding you? If I manually insert draggable="false" on the webcomponent it disallows me to drag as expected.

Yea, I changed it to draggable="false" in the devtools and it updated correctly. Maybe it's just a load time?

@ebidel I think my first comment caused some confusion. I actually meant that adding draggable="false" on the component does work as expected and disallows dragging. However, as this is not documented and not a property, my suggestion is to add it in the examples in the documentation to inform users it is actually possible and working.

Oh gotcha. Are the docs for draggable="true" enough? https://github.com/GoogleWebComponents/google-map/blob/master/google-map-marker.html#L26

eg the absence of draggable or draggable="false" will work as expected.

I don't think that is enough, moreover as the draggable is set on the google-map-marker instead of the google-map. I would prefer an explicit mention, as it cost me quite some time to find how I could disable dragging, until someone was able to help me out on Slack.

I'm not sure we should get in the business of documenting features of a component in other (parent) components, but if it saves folks some time, happy to accept a PR.

However, I'm not convinced we should ever show draggable="false" in an example. You'd really only want that if you had previously set draggable="true". Maybe that could be a one line sentence in the docs. It's obvious to me, but maybe not to others.

Okay I completely misread the title, indicating it is about google-map-marker instead of my usecase of google-map. I am so sorry for causing so much confusion, should have read more carefully. That said I will submit a PR on the docs for my use case. Thank you for your time @ebidel !