Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add ability to click on v-progress-linear #5147

Closed
rchaput opened this issue Sep 22, 2018 · 2 comments
Closed

[Feature Request] Add ability to click on v-progress-linear #5147

rchaput opened this issue Sep 22, 2018 · 2 comments
Assignees
Labels
C: VProgressLinear VProgressLinear T: feature A new feature
Milestone

Comments

@rchaput
Copy link

rchaput commented Sep 22, 2018

Hello

Problem to solve

I want my users to be able to click on a v-progress-linear and react to this change (e.g. by updating the model). A current workaround (thanks to tutsplus.com) is to get the element through a CSS selector, query its width, and compare to the mouse position in the native js click event:

onClickProgress (event) {
  let el = document.querySelector(".progress-linear__bar"),
      mousePos = event.offsetX,
      elWidth = el.clientWidth,
      percents = (mousePos / elWidth) * 100
  doSomething(percents)
}
<v-progress-linear @click="onClickProgress($event)"></v-progress-linear>

However, this workaround is not ideal ; replacing it by a "vuetify" click event would make this code shorter, easier to read and less error-prone.

Such an interactive progress bar would be an alternative to v-slider, with a different appearance (sometimes more pertinent in regard to your interface).

Proposed solution

Please add a click handler to v-progress-linear, which will provide the new progress as an argument (a percentage value, ranging from 0.0 to 1.0 maybe, or 0 to 100)

@Elfayer
Copy link
Contributor

Elfayer commented Sep 26, 2018

It really seems to be a slider you're looking for. I'd suggest you override the v-slider css to get to your expected result. =/
Note: Probably best to create your own component wrapping the v-slider.

@jacekkarczmarczyk
Copy link
Member

@Elfayer linear progress would play nicely with video players, so I'd say it's a valid feature request

@jacekkarczmarczyk jacekkarczmarczyk added the T: feature A new feature label Oct 25, 2018
@MajesticPotatoe MajesticPotatoe added the C: VProgressLinear VProgressLinear label Apr 10, 2019
@johnleider johnleider self-assigned this Apr 22, 2019
@johnleider johnleider added this to the v2.0.0 milestone Apr 22, 2019
johnleider added a commit that referenced this issue Apr 22, 2019
assign component model based upon click

resolves #5147
johnleider added a commit that referenced this issue Apr 26, 2019
* feat(VProgressLinear): add striped variant

* feat(VProgressLinear): add rounded variant

* refactor(VProgressLinear): update height to match spec

* refactor(VProgressLinear): clean-up file

* feat(VProgressLinear): add **reactive** property

assign component model based upon click

resolves #5147

* docs(VProgressLinear): update examples

* docs(VProgressLinear): add **rounded** example

* docs(VProgressLinear): add descriptions for new props

* feat(VProgressLinear): add support for positionable elements

* docs(VProgressLinear): update examples for removed margin

* docs(VProgress): add missing meta information

* refactor(loadable): remove deprecated styles

* feat(VProgressLinear): add **stream** prop

* refactor(VProgressLinear): DRY and clean-up code

* refactor(VProgressLinear): improve stream styles

* fix(VProgressLinear): position element left

* docs(VProgressLinear): add new example

* docs(VProgressLinear): improve example

* docs(VProgressLinear): add description for **stream** prop

* docs(VProgressLinear): add new example

* docs(VProgressLinear): add new example

* docs(VProgressLinear): add new example

* fix(VProgressLinear/VCard): correct styles when **loading**

* chore(VProgressLinear): remove deprecated functionality

* test(VProgressLinear): update snapshots

* docs(VProgressLinear): add information about available slots

* fix(VProgressLinear): fix striped

* docs(VProgressLinear): add kitchen pan

* refactor(VProgressLinear): abstract out normalization function

* chore(VProgressLinear): typo

* docs(VProgressLinear): update scoped slots mapping

* refactor(VProgressLinear): move buffer to computed property

* refactor(VProgressLinear): change how listeners are bound

* style(VProgressLinear): update sass variables

* test(VProgressLinear): update tests

* docs(VProgressLinear): update usage example

* fix(VProgressLinear): remove pointer-events when using the reactive prop

* refactor(VProgressLinear): remove reactive prop and make implicit with change listener

* refactor(VProgressLinear): move keyframes to css file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VProgressLinear VProgressLinear T: feature A new feature
Projects
None yet
Development

No branches or pull requests

5 participants