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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TextField] Disable pointer-events on prefix and suffix elements #4207

Merged
merged 1 commit into from
May 17, 2021

Conversation

whizkydee
Copy link
Member

WHAT is this pull request doing?

Disables pointing device interaction on the prefix and suffix elements of the TextField component. This enables it behave like a label that sends focus to its respective input element, effectively making it easier to interact with the text field itself.

How to 馃帺

馃枼 Local development instructions
馃棐 General tophatting guidelines
馃搫 Changelog guidelines

Copy-paste this code in playground/Playground.tsx:
import React from 'react';
import {Page, TextField} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      <TextField suffix=".myshopify.com" label="Subdomain" />
    </Page>
  );
}
Before After
Screen.Recording.2021-05-17.at.9.56.18.AM.mov
Screen.Recording.2021-05-17.at.9.57.00.AM.mov

馃帺 checklist

  • Tested on mobile
  • Tested on multiple browsers
  • Tested for accessibility
  • Updated the component's README.md with documentation changes
  • Tophatted documentation changes in the style guide
  • For visual design changes, pinged one of @鈥奌YPD, @鈥妋irualves, @鈥妔arahill, or @鈥妑y5n to update the Polaris UI kit

@whizkydee whizkydee self-assigned this May 17, 2021
@whizkydee whizkydee force-pushed the textfield/disable-affix-interactivity branch from a28005e to fdb9cfa Compare May 17, 2021 09:02
Copy link
Member

@alex-page alex-page left a comment

Choose a reason for hiding this comment

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

Thanks @whizkydee!

@whizkydee whizkydee merged commit 52bfe99 into main May 17, 2021
@whizkydee whizkydee deleted the textfield/disable-affix-interactivity branch May 17, 2021 14:51
@lukashlavacka
Copy link

This change broke the behaviour of <Tooltip> components used as prefix/suffix. Cause of #4256

@whizkydee
Copy link
Member Author

Ah, interesting. Didn鈥檛 realize it was being used for interactive elements. I guess this enhancement is probably very specific to the most common use case. We can revert this then.

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.

None yet

3 participants