Tabs - prevent auto tab activation

Open
#6,785 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
angular, bootstrap, typescript
Domain
frontend

Research direction

Start with src/tabs/tabset.component.ts, especially the linked code around line 100 that schedules activation of the first available tab. Check how tabset options are defined and tested, then add the requested autoActivateTab option with a default of true and verify that setting it to false prevents the initial activation while preserving the default behavior.

Written by the indexing model from the issue text.

Description

enhancement

Tabs component automatically activate first available tab: https://github.com/valor-software/ngx-bootstrap/blob/0357a3a7231945a53593d8c795669df460073c99/src/tabs/tabset.component.ts#L100

In most cases this is desired behaviour.

But in my case I have directive that activate tab through reading query param. But it lways activate first tab first and then my directive activate requested in params. My components in tabs are heavy, so I want to prevent unnecessary activation. And even they are light, I want prevent this behaviour to be more clean.

Now I use this hack: Object.assign(this.tabset, { defaultActivationScheduled: true }); and its work.

What I desire:

Add option autoActivateTab with default value true, which can control this case.

Dominant language
TypeScript
Stars
5.5k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from valor-software/ngx-bootstrap

All issues in valor-software/ngx-bootstrap

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.