Skip to content

Textfield should not have hover effects if it is disabled or readonly #42

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Textfield should not have hover effects if it is disabled or readonly #42

wants to merge 1 commit into from

Conversation

callmeberzerker
Copy link

@callmeberzerker callmeberzerker commented Jan 9, 2021

This PR disables all :hover effects if the field is either disabled or readonly.

@forceofseth
Copy link
Contributor

This would help our project. We are using the Textfield in readonly + disabled mode to display data.

@vikignt
Copy link
Owner

vikignt commented Jan 11, 2021

I think for disabled it is enough to specify pointer-events: none; in the global styles of the application, it is in the note in the readme file.
With readonly the question is not unambiguous, this component can be used as an activator of some popup component, for example it is used in Datefield, the calendar opens when readonly and focus is received.
What do you think about this?

@callmeberzerker
Copy link
Author

Thanks for the reply @vikignt

I think for disabled we can safely remove it then. And for the readonly you make a valid use-case but not sure what's the best way to solve it then. I think in general it's helpful to have a readonly presentable form (without the greyed out disabled effects) to read the label/value distinctly. Do you have any suggestion how to solve this? (I will augment this PR)

@sourcegr
Copy link

sourcegr commented May 9, 2021

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants