Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

[md-slider] Update thumb text on KEY_CODE.LEFT_ARROW and KEY_CODE.RIGHT_ARROW events #791

Closed
tullo opened this issue Nov 28, 2014 · 2 comments
Assignees
Milestone

Comments

@tullo
Copy link

tullo commented Nov 28, 2014

The "Rating" slider demo https://material.angularjs.org/#/demo/material.components.slider does not currently update the thumb text on left | right keyboard events.

The fix below should solve that. Tested with v0.6.0-rc3

<md-slider md-discrete ng-model="rating" step="1" min="1" max="5" aria-label="rating">

diff --git a/src/components/slider/slider.js b/src/components/slider/slider.js
index 9454f2a..3227e79 100644
--- a/src/components/slider/slider.js
+++ b/src/components/slider/slider.js
@@ -235,6 +235,7 @@ function SliderController($scope, $element, $attrs, $$rAF, $window, $mdAria, $md
         ev.stopPropagation();
         $scope.$evalAsync(function() {
           setModelValue(ngModelCtrl.$viewValue + changeAmount);
+          thumbText.text( ngModelCtrl.$viewValue );
         });
       }
     }
@ThomasBurleson
Copy link
Contributor

Related to #817

@robertmesserle
Copy link
Contributor

This is resolved by PR #820

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants