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

Highlighted Option is Un-selectable

Open dsuwirya opened this issue 7 years ago • 6 comments

Hi,

I'm currently using ng2-select v1.2.0, with Angular 2.4.8 - and experiencing a little problem with ng2-select multiple.

I have a country list just like the demo. When I start typing letters, then filtered options will be displayed correctly. But after that, clicking any highlighted text doesn't make it selected. This only happen if I click exactly on top of that highlighted text area, while if I click the surrounding it will be selected correctly.

I then tried to include directly the source. If I commented out the part where it's adding "strong" tag in the HighlightPipe ( line 18 ), then yes none of the option will show the highlighted part, but it's now becoming selectable correctly.

I attached the screenshot on how that particular highlighted part is rendered ( in Chrome ):

image

Hope somebody can help. Thanks.

dsuwirya avatar Mar 27 '17 22:03 dsuwirya

Me too facing the exact same issue but its not the solution to remove highlight feature.

amitgaur208 avatar Mar 31 '17 10:03 amitgaur208

@dsuwirya in which file you removed highlight pipe as i was checking it by removing but still working same with issue

amitgaur208 avatar Apr 01 '17 05:04 amitgaur208

I tried removing it from select-pipes.ts > HighlightPipe, on the line where it's adding strong tag.

dsuwirya avatar Apr 05 '17 18:04 dsuwirya

@dsuwirya Yes i found that but still not working in all browser and devices. Its too buggy. I need to use another alternate.

amitgaur208 avatar Apr 07 '17 04:04 amitgaur208

We seem to have found the same issue, except that the initially mentioned workaround yielded no change in functionality. It is true that the option text is not clickable, but the enclosing div is. This may be a browser bug, as we replicated the issue in Chrome v57 but not in v58. This simple workaround fixes it with CSS:

.ui-select-choices-row .dropdown-item { pointer-events: none; }

.ui-select-choices .ui-select-choices-row { cursor: pointer; }

BBaysinger avatar May 01 '17 19:05 BBaysinger

@BBaysinger workaround fixed the issue for Chrome v66. To apply it in styles.scss had to add /deep/ option:

.ui-select-choices-row /deep/ .dropdown-item {
    pointer-events: none !important;
}

.ui-select-choices /deep/ .ui-select-choices-row {
    cursor: pointer !important;
}

StDannyDan avatar May 23 '18 07:05 StDannyDan