taiga-ui icon indicating copy to clipboard operation
taiga-ui copied to clipboard

feat(core): add InjectionToken to config scrollbars

Open ddubrava opened this issue 2 years ago • 5 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows Conventional Commits
  • [ ] Tests for the changes have been added (for bug fixes / features)
  • [x] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [ ] Bugfix
  • [x] Feature
  • [ ] Refactoring
  • [ ] Code style update
  • [ ] Build or CI related changes
  • [ ] Documentation content changes

What is the current behavior?

Closes #1525

What is the new behavior?

TUI_DISABLE_CUSTOM_SCROLLBAR token is added to disable a custom scrollbar and enable a native one.

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

ddubrava avatar May 21 '22 19:05 ddubrava

Pull request was closed :heavy_check_mark:

All saved screenshots (for current PR) were deleted :wastebasket:

lumberjack-bot[bot] avatar May 21 '22 20:05 lumberjack-bot[bot]

The idea is to toggle tui-zero-scrollbar to control a native scrollbar. Showing/hiding tui-scroll-controls helps to control a custom scrollbar.

Please, check isScrollbarShown$ getter, I'm not sure I got the logic there.

ddubrava avatar May 21 '22 20:05 ddubrava

Codecov Report

Merging #1793 (0be7459) into main (3923c28) will increase coverage by 0.02%. The diff coverage is 83.33%.

@@            Coverage Diff             @@
##             main    #1793      +/-   ##
==========================================
+ Coverage   63.27%   63.29%   +0.02%     
==========================================
  Files         934      935       +1     
  Lines       10082    10089       +7     
  Branches     1949     1950       +1     
==========================================
+ Hits         6379     6386       +7     
+ Misses       3248     3247       -1     
- Partials      455      456       +1     
Flag Coverage Δ
addon-charts 74.42% <ø> (ø)
addon-doc 26.73% <ø> (ø)
addon-editor 45.97% <ø> (ø)
addon-mobile ∅ <ø> (∅)
addon-table 79.59% <ø> (ø)
addon-tablebars ∅ <ø> (∅)
cdk 69.09% <ø> (ø)
core 68.15% <83.33%> (+0.10%) :arrow_up:
kit 63.04% <ø> (ø)
summary 63.29% <83.33%> (+0.02%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...nents/scroll-controls/scroll-controls.component.ts 73.68% <80.00%> (+9.39%) :arrow_up:
projects/core/tokens/scrollbars-options.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3923c28...0be7459. Read the comment docs.

codecov[bot] avatar May 21 '22 20:05 codecov[bot]

@waterplea @splincode

Hey there, take a look, please!

I left a comment in the last thread, why I didn't use a factory.

The second moment is that tui-scroll-controls component logic might be confusing now since it handles toggling of native scrollbar. As a result, we can't hide this component using *ngIf otherwise native scrollbar is visible. Any other ideas how can we toggle native scrollbar?

ddubrava avatar May 29 '22 19:05 ddubrava

@ddubrava sorry for waiting, we will contact you shortly to discuss the details

splincode avatar Jul 07 '22 07:07 splincode

@ddubrava @waterplea What do you think about this, is it worth further development of this PR?

splincode avatar Oct 12 '22 07:10 splincode

@ddubrava @waterplea What do you think about this, is it worth further development of this PR?

I think at some point it can be useful. if you need this feature, I can work on this. But the current logic is a little bit complicated, there are some hacks. So we need to discuss what we have now and come up with the best solution.

ddubrava avatar Oct 12 '22 08:10 ddubrava

@ddubrava can we refactor existing code without extra options?

splincode avatar Oct 12 '22 08:10 splincode

I think it will be necessary to call the whole team next year and discuss this

splincode avatar Dec 30 '22 14:12 splincode