Giter Club home page Giter Club logo

Comments (6)

vskosp avatar vskosp commented on July 29, 2024

Hi @WideAwake,

Currently behavior is you should click enter button to apply changes. I think it may cause issues on mobile devices.

from vsgoogleautocomplete.

sanjsdev avatar sanjsdev commented on July 29, 2024

is this issue solved ? i'm also facing same issue(empty the input)

from vsgoogleautocomplete.

vskosp avatar vskosp commented on July 29, 2024

Will be solved asap

from vsgoogleautocomplete.

matteoPhre avatar matteoPhre commented on July 29, 2024

i've had the same problem and fixed it forcing the clear of autocomplete model:
the 'autocomplete' parameter is the input where autocomplete is located;

var input = angular.element(document.querySelectorAll('input[name=autocomplete_location]'));
clearAutoCompleteModel(getAutoCompleteObj(input[0]));

function getAutoCompleteObj(element) {
    for (var key in element) {
        if (key.indexOf('jQuery') == 0 && element[key].$vsGoogleAutocompleteController)
            return element[key];
    }
}

function clearAutoCompleteModel(autocomplete) {
            let auto = autocomplete;
            let modelCtrl = auto.$ngModelController;
            let viewValue = modelCtrl.$viewValue == "" ? '' : modelCtrl.$viewValue;
            if (!viewValue) $scope.jobPosition = new JobPosition();
            $timeout(function () {
                $scope.$apply(function () {
                    modelCtrl.$setViewValue(viewValue);
                    modelCtrl.$render();
                });
            });
        };

this make me able to clean input after the selection of one place inside autocomplete. i think it's easy to fix it directly inside the code. Obviusly there'll be an issue with the required validation, that doesn't accept any empty value.
Now i'm not able to give time to this issue, but i would like to make a PR.

from vsgoogleautocomplete.

Markj89 avatar Markj89 commented on July 29, 2024

What line should I put this in? because I'm getting a Cannot read property '$ngModelController' of undefined in my console.

from vsgoogleautocomplete.

wbaizer avatar wbaizer commented on July 29, 2024

Was this problem ever fixed? It still persists today @vskosp

from vsgoogleautocomplete.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.