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

Defferent behaviuor of caret in multiple version with append-to-body

Open piernik opened this issue 10 years ago • 6 comments
trafficstars

If I turn append-to-body on in multiple version after selecting item with enter caret is not in field - I have to click fiels once again to focus. With append-to-body off everything is ok

piernik avatar Jun 24 '15 12:06 piernik

+1

ivanzotov avatar Aug 11 '15 21:08 ivanzotov

It happens because the element is replaced on focus out

ivanzotov avatar Aug 12 '15 12:08 ivanzotov

Look at my pull request, maybe it is not good way to solve, but it works https://github.com/angular-ui/ui-select/pull/1142

ivanzotov avatar Aug 12 '15 13:08 ivanzotov

Can you post a reproduction in Plunker?

wesleycho avatar Mar 27 '16 23:03 wesleycho

Monky-patching for now with a sibling directive to "ui-select":

'use strict';

angular.module('x').directive("uiSelectFocusPatch", function ($timeout) {
    // https://github.com/angular-ui/ui-select/issues/1039
    function link(scope, element, attrs) {
        scope.$watch('$select.open', function () {
            $timeout(function () {
                scope.$select.setFocus();
            });
        });
    }

    return {
        restrict: "A",
        require: ['uiSelect'],
        scope: true,
        link: link
    };
});

Please note the $timeout service. The fix for #1003 does not seem to work for me.

fs5 avatar Apr 13 '16 10:04 fs5

How about this? <ui-select on-select="$select.setFocus()" ... </ui-select>

cameronlowry avatar Jun 21 '18 09:06 cameronlowry