NUKnightLab / NUKnightLab/TimelineJS3
initial_zoom: 0 is ignored
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.2k
- Forks
- 645
- PR merge metrics
- No merged PRs in 30d
Description
This issue is caused by this line: https://github.com/NUKnightLab/TimelineJS3/blob/6a78272866d86e10baf6c025941347e7bc946011/src/js/timeline/Timeline.js#L437
The if condition inappropriately bypasses setting the initial zoom to index 0 due to the falsy nature of JavaScript and should, instead, be something like:
if (this.options.initial_zoom !== undefined && this.options.initial_zoom !== null)
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 at src/js/timeline/Timeline.js around line 437, using the linked revision as the reference point. Reproduce the configuration with initial_zoom set to 0 and inspect how the current condition handles it. Done means an explicit zero value is honored as the initial zoom, without changing behavior for omitted or null values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100