• DEVHIDE
        • Home (current)
        • About
        • Contact
        • Cookie
        • Home (current)
        • About
        • Contact
        • Cookie
        • Disclaimer
        • Privacy
        • TOS
        Login Or Sign up

        Angular-material ng-click strange border highlight

        32.1k Views Asked by Rus Paul At 22 June 2015 at 13:39 2025-12-01T22:15:33.458000

        I have a problem with using AngularJS and Angular-Material.

        Take a look at the following code:

        <div flex="100">
           <ul class="list-group">
               <li class="list-group-item cursorPointer" 
                ng-repeat="item in array" ng-click="selectItem(item)">
                  {{item.name}}
               </li>
            </ul>
        </div>
        

        The li tag has a ng-click function attach to it that contains some business logic. The problem is that there appears a strange border when you click on it (similar to user-selection highlight) and I can't seem to figure out where is it coming from.

        This seems to appear only when I have an ng-click directive on an element (same behavior on span element)

        Versions used:

        AngularJS - 1.4.1

        Angular-Material - 0.9.4

        Angular-Aria - 1.4.0

        Angular-Animate - 1.4.1

        Angular-UI-Boostrap - 0.9.0

        Bootstrap - 3.2.0

        JQuery - 2.1.4

        Any ideas? See this plnkr for example: http://plnkr.co/edit/60u8Ur?p=preview

        css angularjs angularjs-ng-click angular-material
        Original Q&A
        3

        There are 3 best solutions below

        6
        ajmajmajma ajmajmajma On 22 June 2015 at 14:11 BEST ANSWER

        Your problem is the :focus, you can get around by doing something like this

         span:focus {
            outline: none;
            border: 0;
         }
        

        So this is just for your span, you could get more specific on other items if you wanted to remove it elsewhere.

        0
        bhv bhv On 29 March 2017 at 04:52

        this may be easy :

        add nofocus class to that elements,

        and add css to that class on :focus

        .nofocus:focus {
            outline: none;
        }
        
        0
        Amit Thakur Amit Thakur On 13 February 2018 at 07:02

        I faced the same issue with most of the elements.

        In my case following CSS codes worked:

        *:focus {
            outline: none !important;
            border: 0 !important;
        }
        

        Related Questions in CSS

        • CSS Class is not applying to element (border width,color,and style attributes)
        • How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?
        • Positioning child at bottom of parent with scroll
        • Play multiple audio files in a slider
        • How to set text over image?
        • Website zoomed out on Android default browser
        • Writing/Overwriting to specific XML file from ASP.NET code behind
        • My navbar is not expanding after collapse
        • when a checkbox is checked how to display a different hidden element using javascript
        • Gaps Vertically Using Dividers
        • CSS: Preventing a property to affect on element until the end of transition
        • Polygon Button with pure CSS
        • transform-origin doesnt apply in safari
        • show/hide multiple div tags at once and change the size of the remaining div tag
        • Mask the image/maps/div (circle) using css and jquery

        Related Questions in ANGULARJS

        • Angular Show All When No Filter Is Supplied
        • Using pagination on a table in AngularJS
        • State with different subviews
        • Getting and passing MVC Model data to AngularJS controller
        • Implementing prerender.io middleware in sails.js
        • Token based authorization in nodejs/ExpressJs and Angular(Single Page Application)
        • AngularJS, Google App Engine and URLrewrite
        • send data from table to another page into forms
        • How to write tests for classes with inheritance
        • angularJS sending OPTIONS instead of POST
        • Receiving POST from external application in AngularJS
        • Metaprogramming AngularJS Filters
        • Reload List after Closing Modal
        • Why is my angularjs site not completely crawlable?
        • Why is separation of JavaScript and HTML a good practice?

        Related Questions in ANGULARJS-NG-CLICK

        • In Angular, why does ng-click button fires multiple times?
        • ngClick with window.location.href lands redirect twice
        • ng-repeat and ng-click in the same tag
        • How can I open a modal from a modal template?
        • How can I get ng-click to function with ng-repeat and ng-bind-html?
        • Call service method from ngClick directly without calling the controller function
        • Changing scope variable on ng-click without calling a function
        • ng-click doesn't work with fotorama plugin
        • How to change the state of multiple variables on click event?
        • ng-click not working on newly appended elements
        • Angular in chrome auto-firing ng-click
        • ng-click value change + $scope.watch bind not working properly
        • Toggle content using ng-click
        • Angular-material ng-click strange border highlight
        • ng-click inside ui-router not firing

        Related Questions in ANGULAR-MATERIAL

        • Show chips from db in form
        • AngularJS Material using $mdDialog in a directive linking function
        • $mdDialog stacked/nested dialogs, is it possible?
        • How to angularjs app.service and $q in typescript
        • Error: $compile:ctreq Missing Required Controller
        • Angular material tabs pagination doesn't change
        • md-sidenav overflow not working
        • How to pass the $event to the onEnter function of angular ui router state
        • Material Angular md-cotent don't get 100% of height
        • Compile angular directive dynamically
        • Ng-pickadate translations
        • Why does the angular-material `Getting Started` example not actually work?
        • Refresh tab content Angular material
        • Angular Material - Long Textarea Forces Scroll To Top
        • ngAnimate not adding classes with angular-material

        Trending Questions

        • UIImageView Frame Doesn't Reflect Constraints
        • Is it possible to use adb commands to click on a view by finding its ID?
        • How to create a new web character symbol recognizable by html/javascript?
        • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
        • Heap Gives Page Fault
        • Connect ffmpeg to Visual Studio 2008
        • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
        • How to avoid default initialization of objects in std::vector?
        • second argument of the command line arguments in a format other than char** argv or char* argv[]
        • How to improve efficiency of algorithm which generates next lexicographic permutation?
        • Navigating to the another actvity app getting crash in android
        • How to read the particular message format in android and store in sqlite database?
        • Resetting inventory status after order is cancelled
        • Efficiently compute powers of X in SSE/AVX
        • Insert into an external database using ajax and php : POST 500 (Internal Server Error)

        Popular # Hahtags

        javascript python java c# php android html jquery c++ css ios sql mysql r reactjs

        Popular Questions

        • How do I undo the most recent local commits in Git?
        • How can I remove a specific item from an array in JavaScript?
        • How do I delete a Git branch locally and remotely?
        • Find all files containing a specific text (string) on Linux?
        • How do I revert a Git repository to a previous commit?
        • How do I create an HTML button that acts like a link?
        • How do I check out a remote Git branch?
        • How do I force "git pull" to overwrite local files?
        • How do I list all files of a directory?
        • How to check whether a string contains a substring in JavaScript?
        • How do I redirect to another webpage?
        • How can I iterate over rows in a Pandas DataFrame?
        • How do I convert a String to an int in Java?
        • Does Python have a string 'contains' substring method?
        • How do I check if a string contains a specific word?
        .

        Copyright © 2021 Jogjafile Inc.

        • Disclaimer
        • Privacy
        • TOS
        • Homegardensmart
        • Math
        • Aftereffectstemplates