Semantics of IControl.onAdd/onRemove are inconsistent
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
Semantics of `onAdd`: expected to create and return a DOM element which Map will add within its own div.
Semantics of `onRemove`: expected to remove its own DOM element.
Surprised this inconsistency hasn't been flagged before.
It seems to me that `map.removeControl(X)` should remove X, rather than relying on X to remove itself.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the IControl.onAdd and IControl.onRemove semantics, then trace map.removeControl(X) to understand which side currently owns removal of the DOM element. Done means the control lifecycle has consistent ownership semantics, with behavior matching the issue's expectation that removing a control removes X.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100