Skip to content

tagAppendAttributes() et al doesn't work with non-tagified objects #374

@cpsievert

Description

@cpsievert

Functions that are intended to modify tags, like tagAppendAttributes(), bindFillRole(), etc. should probably be tagify()-ing their input, or else you get weird behavior:

> str(tagAppendAttributes(leaflet::leaflet(), foo = "bar"))
List of 9
 $ x            :List of 1
  ..$ options:List of 1
  .. ..$ crs:List of 5
  .. .. ..$ crsClass       : chr "L.CRS.EPSG3857"
  .. .. ..$ code           : NULL
  .. .. ..$ proj4def       : NULL
  .. .. ..$ projectedBounds: NULL
  .. .. ..$ options        : Named list()
  .. .. ..- attr(*, "class")= chr "leaflet_crs"

[...]

 $ attribs      :List of 1
  ..$ foo: chr "bar"
 - attr(*, "class")= chr [1:2] "leaflet" "htmlwidget"
 - attr(*, "package")= chr "leaflet"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions