NUKnightLab / NUKnightLab/TimelineJS3

initial_zoom: 0 is ignored

Open
#848 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.