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

Press enter on button that has focus doesn't work #90

Open
tesicg opened this issue Jun 29, 2016 · 0 comments
Open

Press enter on button that has focus doesn't work #90

tesicg opened this issue Jun 29, 2016 · 0 comments

Comments

@tesicg
Copy link

tesicg commented Jun 29, 2016

I have AngularJS template (modal dialog) and there is a code as following:

<div class="col-sm-9 dlg-input-pr">
    <div>
        <label for="ClientsURL">URL for client</label>
        <input id="ClientsURL" ng-model="publishOptions.uniqueURL" type="text" class="uui-form-element" value="{{publishOptions.uniqueURL}}" select-on-click tabindex="1" />
    </div>
</div>
<div class="col-sm-3 dlg-btn screen">
    <ng-switch on="isPublishOptionsHidden">
        <button ng-switch-when="true"
                class="uui-button lime-green"
                clip-copy="getTextToCopy()"
                auto-focus>
            Copy
        </button>
        <button ng-switch-when="false"
                class="uui-button lime-green"
                clip-copy="getTextToCopy()">
            Copy
        </button>
    </ng-switch>
</div>

Here is function that gets the text to be copied:

$scope.getTextToCopy = function () {
    return $scope.publishOptions.uniqueURL;
};

The first goal is to put focus on button when dialog opens, which I did using auto-focus directive. The second goal is to add the possibility when focus is on button to press enter and copy text from input box (ClientsURL). It doesn't work that is doesn't copy text to clipboard. It works when I click button using mouse.

How to solve this issue?

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