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

Textfield inside Dialog in Safari - carret is hidden #16105

Closed
2 tasks done
koshkarik opened this issue Jun 7, 2019 · 19 comments
Closed
2 tasks done

Textfield inside Dialog in Safari - carret is hidden #16105

koshkarik opened this issue Jun 7, 2019 · 19 comments
Labels
browser: Safari bug 🐛 Something doesn't work external dependency Blocked by external dependency, we can’t do anything about it

Comments

@koshkarik
Copy link

koshkarik commented Jun 7, 2019

If Textfield is inside of Dialog and initial value is set to '' - there will be no cursor in Safari

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔

Cursor must be visible in Safari like in other browser

Steps to Reproduce 🕹

Add Textfield with initial value '' in Dialog and open it in Safari

https://codesandbox.io/s/material-demo-exxfo

There will be background: none css in input, if you will uncheck it - everything will work as expected in Safari

Tech Version
Material-UI v4.0.2
React 16.9.0
Browser Safari
@oliviertassinari oliviertassinari added duplicate This issue or pull request already exists and removed duplicate This issue or pull request already exists labels Jun 7, 2019
@oliviertassinari
Copy link
Member

@koshkarik It seems to also be related to the position: relative of the parent elements. Do you have an idea of how we can fix the problem? Do you think that you could open an issue on Safari side? It seems like a problem with their rendering engine.

@oliviertassinari oliviertassinari added external dependency Blocked by external dependency, we can’t do anything about it bug 🐛 Something doesn't work labels Jun 8, 2019
@koshkarik
Copy link
Author

koshkarik commented Jun 11, 2019

Yep, i will open an issue on Safari side 👌

@koshkarik
Copy link
Author

No luck to reproduce the problem with pure html and css in safari - so not enough facts to open issue on Safari side(

@koshkarik
Copy link
Author

@oliviertassinari I didn't figure out how to fix this problem in mui( I do understand I can simply overwrite input styles (background) and it will solve the problem for me, but in our project we have a lot of inputs in modals, so this style fix will make a lot of crutches. Do you have any idea how to solve it in mui?

@oliviertassinari
Copy link
Member

@koshkarik Copy & pasting the HTML output seems to be enough: https://codepen.io/anon/pen/agmmMR to reproduce. Maybe we can clean the codepen as much as possible to be minimal?

@Alex-cr17
Copy link

Alex-cr17 commented Jun 20, 2019

I have the same bug. But I found temporary solution.
default state for input:
input: focus {
outline: 0;
}
I set it up:
input:focus {
outline: 1;
outline-width: 100000px // Hiding an outline that is drawn around elements, OUTSIDE the borders, to
make the element " not stand out" if it is necessary.
}

@koshkarik
Copy link
Author

@oliviertassinari I have finally opened an issue on Safari side with your example https://bugs.webkit.org/show_bug.cgi?id=199188 If it will be needed i will clean up the example from the rest of unnecessary things. I hope they will reply soon about this issue, but there is a big chance that fixing this bug in Safari will take a while and a lot of people will face this problem for that period of time... May be it's possible to make quick fix in material ui, what do you think of it?

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 25, 2019

May be it's possible to make quick fix in material ui, what do you think of it?

@koshkarik How? Do you know a fix that can be deployed without breaking people code?

I have finally opened an issue on Safari side with your example https://bugs.webkit.org/show_bug.cgi?id=199188

Thank you!

@koshkarik
Copy link
Author

koshkarik commented Jun 25, 2019

@oliviertassinari actually didn't figure this out yet :(

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 25, 2019

I hope that the Safari team will be able to help. Given they have acces to advanced debugging tools, they might be able to explain what's going on and how to fix it.

@koshkarik
Copy link
Author

@oliviertassinari how do you think, is it possible do add zIndex: 1 to InputBase somewhere here https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/InputBase/InputBase.js#L32 ? Because it definitely fixes this issue and i believe (have checked it, but don't know for sure) it doesn't break anything.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 26, 2019

Hum. Adding a z-index would move the component into its own stacking context so it might break people visual layout. If we try it, it's also possible that we will have to revert it (based on people bug reports).

cc @mui-org/core-contributors

@koshkarik
Copy link
Author

Hello! Any updates on this issue?

@oliviertassinari
Copy link
Member

What's new?

@hemanursawarrior
Copy link

hemanursawarrior commented Jul 16, 2019

I see this issue (cursor is missing when value is '', but appears when value != '') in Safari 12.1 on Mojave, but I noticed two things:

  1. While it occurs when using Textfield directly from material-ui in a new react app, it does not appear when viewing the official material-ui page: https://material-ui.com/components/text-fields/ So there is something that is causing this to occur from the application/framework side (that possibly Safari is not handling correctly)

  2. As for the Safari side, it is in fact fixed in Safari 13 in Catalina.

@KristiyanTs
Copy link

@hemanursawarrior the issue is there(on Safari only) if you open the dialog with a form on the /components/dialogs page. I created an issue for this as in dialogs navigating with Tab also does not work ( #17403 )

@sashless
Copy link

sashless commented Dec 14, 2020

I have a similar problem on Safari 14 and it is happening for me in fullscreen dialog only. In fullsceen dialog the caret is cut off for MuiSelect and MuiTextField is also cut off. This can be fixed by adding z-index: 1 to MuiTextField-root as suggested in this comment #16105 (comment) or for Select MuiFormControl-root

@siriwatknp
Copy link
Member

I think this is outdated, I cannot reproduce this in the latest Safari.

Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@koshkarik How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser: Safari bug 🐛 Something doesn't work external dependency Blocked by external dependency, we can’t do anything about it
Projects
None yet
Development

No branches or pull requests

7 participants