Skip to content

Mat-select and ctrl+c changes selected item #14274

@PepijnDhollander

Description

@PepijnDhollander

Bug, feature request, or proposal:

I want to copy the selected value by selecting (highlighting) it and pressing ctrl+C
but the list jumps to the first item that begins with C

What is the expected behavior?

the selected text is copied to clipboard
and the selected item is unchanged

What is the current behavior?

the selected text is copied to the clipboard
and the selected item is changed

What are the steps to reproduce?

Similar to Ctrl+C but with Ctrl+P
in the default stackblitz of mat-select basic:
https://stackblitz.com/angular/nlmxjolypgj?file=app%2Fselect-overview-example.ts

select item "Tacos" , highlight it and hold the mouse button until outside the mat-select component
(otherwise the dropdown opens)
now press Ctrl+P which should print the screen with "Tacos" selected
But the screen is printed with "Pizza" selected

The "highlighting" is not the cause because clicking the preview and focussing on the first mat-select by using "tab" and then pressing Ctrl+P has the same result ("Pizza" is selected)

What is the use-case or motivation for changing an existing behavior?

the client wants to copy the selected value to another location

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Material 7.1

Is there anything else we should know?

please ask

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions