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

copy to clipboard by checkbox not working #29

Open
webcane opened this issue Sep 24, 2016 · 0 comments
Open

copy to clipboard by checkbox not working #29

webcane opened this issue Sep 24, 2016 · 0 comments

Comments

@webcane
Copy link

webcane commented Sep 24, 2016

it's not working in google chrome v.53. Here is my example:

        <div ng-app="myApp" ng-controller="myController as c">
            <!-- Target/Trigger -->
            <input id="foo" type="checkbox"
                ngclipboard data-clipboard-target="#foo"
                ngclipboard-success="onSuccess(e);" value="Bike" /> I have a bike <br/>
        </div>
(function () {
  'use strict';

  angular.module('myApp', ['ngclipboard']);
  angular.module('myApp').controller('myController', function($scope){
    $scope.onSuccess = function(e){
      console.info('Action:', e.action);
      console.info('Text:', e.text);
      console.info('Trigger:', e.trigger);

      e.clearSelection();
    };
  });
})();

and issue
Uncaught InvalidStateError: Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('checkbox') does not support selection.

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

No branches or pull requests

1 participant