Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(input, select, autocomplete): wrong cursor on hover inner padding #26491

Closed
1 task
RobinKamps opened this issue Jan 24, 2023 · 9 comments · Fixed by #27795
Closed
1 task

bug(input, select, autocomplete): wrong cursor on hover inner padding #26491

RobinKamps opened this issue Jan 24, 2023 · 9 comments · Fixed by #27795
Labels
area: material/form-field P4 A relatively minor issue that is not relevant to core functions

Comments

@RobinKamps
Copy link

RobinKamps commented Jan 24, 2023

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

According to the Material Standard the cursor should always be text for autocomplete & input and pointer for select.
Instead the cursor is only set to text/pointer on the standard html element - not the container, which has a padding where the cursors are default.
On the select it gets a bit more wierd, because the cursor wobbles from default (on the container padding) to text (on the label) to the pointer (on the html standard input).
inputs-cursor

Reproduction

Steps to reproduce:

  1. head to the docs for autocomplete/input or select .e.g. https://material.angular.io/components/select/overview
  2. hover over the elements

Expected Behavior

the cursor should stay the same if hovered over the component.

Actual Behavior

the cursor is different on the container padding / label (not material strandard compliant)

Environment

  • Angular: 15.1.1
  • CDK/Material: 15.1.1
  • Browser(s): all
  • Operating System (e.g. Windows, macOS, Ubuntu): all
@RobinKamps RobinKamps added the needs triage This issue needs to be triaged by the team label Jan 24, 2023
@CramericaIndustries
Copy link

Just was about to report the same bug. Wrong cursor appears also when you hover the mouse above the mat-label (red frame)
image

My CSS workaround for mat-select is...

mat-form-field:has(mat-select) mat-label {
    cursor: pointer;
}

@crisbeto crisbeto added P4 A relatively minor issue that is not relevant to core functions area: material/form-field and removed needs triage This issue needs to be triaged by the team labels May 3, 2023
@felhag
Copy link
Contributor

felhag commented Sep 15, 2023

Looks to me like this fix is the culprit. If you remove the pointer-events: all css property the cursor behaves fine.

@RobinKamps
Copy link
Author

unfortunetaly this fix in 16.2.5 does not work on inputs and thus do not work on autocomplete (works on selects only).

input-cursor

@felhag
Copy link
Contributor

felhag commented Sep 21, 2023

@RobinKamps This was actually intended by me. Since clicking the label is actually focusing the input I think it make sense to style it as a text cursor. Couldn't find much about it in the specs though... @crisbeto What do you think?

@crisbeto
Copy link
Member

Yeah I think it makes sense that it's styled as a text cursor since it is a text input.

@RobinKamps
Copy link
Author

its not about the text cursor, but about where it should be applied.
the m2 material specs seems to have slighly different text cursor behavior. The labels have default cursor instead of text cursor on both appearances. On appearance outline the cursor is text for the wole input (no default cursor above and below the input) except for the right and left padding. In m3 / web material specs nothing can be found about the hover / cursor.

Angular Material MDC implementation has text cursor on the labels and different margins on appearance outline.

@RobinKamps
Copy link
Author

Animation

@RobinKamps
Copy link
Author

RobinKamps commented Sep 22, 2023

but anyway: using the whole input (without any default cursor)

.mdc-text-field {
  cursor: text;
}

results in a much better user experience in my opinion then the different cursors/paddings etc.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/form-field P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants