Skip to content

fix(tooltip): text fields not editable if tooltip is applied in safari #12959

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

Merged
merged 1 commit into from
Sep 11, 2018

Conversation

devversion
Copy link
Member

@devversion devversion commented Sep 3, 2018

Applying matTooltip directly on a <input> or <textarea> element causes HammerJS to add a user-select: none inline style. This prevents users from typing into the text fields in Safari.

Since the user-select: none is not needed for the longpress event, we can just always reset the user-select if a tooltip is applied on a text-field because we want to avoid such issues.

Fixes #12953

@devversion devversion added the target: patch This PR is targeted for the next patch release label Sep 3, 2018
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 3, 2018
} else if (_platform.IOS && (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA')) {
}

if ((_platform.IOS || _platform.SAFARI) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, I think that we should do this on all browsers. Text selection is something pretty fundamental to inputs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Also the the user-select: none is mostly needed if something is being panned/dragged. So we should be good always removing the user-select.

Copy link
Member Author

@devversion devversion Sep 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I've updated the commit message but kept the title because the changelog should show that the specific safari case has been fixed.

Applying `matTooltip` directly on a `<input>` or `<textarea>` element causes HammerJS to add a `user-select: none` inline style. This prevents users from typing into the text fields in Safari.

Since the `user-select: none` is not needed for the `longpress` event, we can just **always reset** the `user-select` if a tooltip is applied on a text-field because we want to avoid such issues.

Fixes angular#12953
@devversion devversion force-pushed the fix/tooltip-safari-input branch from 3299370 to 6d5e883 Compare September 3, 2018 10:12
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crisbeto crisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Sep 3, 2018
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn merged commit 0389d12 into angular:master Sep 11, 2018
jelbourn pushed a commit that referenced this pull request Sep 11, 2018
#12959)

Applying `matTooltip` directly on a `<input>` or `<textarea>` element causes HammerJS to add a `user-select: none` inline style. This prevents users from typing into the text fields in Safari.

Since the `user-select: none` is not needed for the `longpress` event, we can just **always reset** the `user-select` if a tooltip is applied on a text-field because we want to avoid such issues.

Fixes #12953
@ArgV04
Copy link

ArgV04 commented Oct 23, 2018

How can I get this fix? Is this in version 6.4.7?

@devversion
Copy link
Member Author

devversion commented Oct 23, 2018

@ArgV04 It's available in 7.0.0 and 7.0.1 (including all beta's and RCs for v7)

@ArgV04
Copy link

ArgV04 commented Oct 23, 2018

Ok thanks, we cannot currently update to major 7.x.x because we have other dependencies based on version 6.4.x and these not have done the jump to v7

@tibinthomas
Copy link

Any breaking changes from v6 to v7. Does anyone have a upgrade guide? Thanks in advance.

@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 Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mat-input with matTooltip is un-editable in Safari
6 participants