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

fix(TextField): Mobile SafariでTextField type=dateの高さが潰れてしまうのを修正 #1550

Merged
merged 2 commits into from
Mar 29, 2024

Conversation

Qs-F
Copy link
Collaborator

@Qs-F Qs-F commented Mar 27, 2024

User description

チケット

実装内容

  • Mobile SafariでTextField type=dateの高さが潰れてしまうのを修正

スクリーンショット

変更前 変更後
image image image image

相談内容(あれば)

  • Safariだと下の画像のようにテキストの位置がずれてしまうのだが、inputにflexをいれると今度はChrome等で表示が崩れるので一旦無視してます
image

Type

bug_fix


Description

  • Fixed an issue where the height of TextField components with type=date was being crushed in Mobile Safari.
  • Ensured proper text alignment in date input fields by adding a CSS rule.

Changes walkthrough

Relevant files
Bug fix
TextField.tsx
Fix TextField Height Issue for Type Date on iOS                   

packages/for-ui/src/textField/TextField.tsx

  • Adjusted the height of the TextField component for type=date to
    prevent it from being crushed in Mobile Safari.
  • Added a specific CSS rule &::-webkit-date-and-time-value]:text-start
    to ensure proper text alignment in date input fields.
  • +1/-1     

    PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link

    changeset-bot bot commented Mar 27, 2024

    🦋 Changeset detected

    Latest commit: 20671fb

    The changes in this PR will be included in the next version bump.

    This PR includes changesets to release 1 package
    Name Type
    @4design/for-ui Patch

    Not sure what this means? Click here to learn what changesets are.

    Click here if you're a maintainer who wants to add another changeset to this PR

    Copy link

    PR-Agent was enabled for this repository. To use it, please link your git user with your CodiumAI identity here.

    PR Description updated to latest commit (c24da01)

    Copy link

    PR-Agent was enabled for this repository. To use it, please link your git user with your CodiumAI identity here.

    PR Review

    ⏱️ Estimated effort to review [1-5]

    2, because the PR involves a specific bug fix with a clear description and a single change in the code. The change is straightforward and targets a specific CSS issue on Mobile Safari. The complexity is low, and the change is isolated to a single component.

    🧪 Relevant tests

    No

    🔍 Possible issues

    CSS Specificity: The added CSS rule &::-webkit-date-and-time-value]:text-start might have specificity issues with existing styles or future styles. It's important to ensure this rule doesn't unintentionally override or conflict with other CSS.

    🔒 Security concerns

    No


    ✨ Review tool usage guide:

    Overview:
    The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.

    The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.

    • When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:
    /review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
    
    [pr_reviewer]
    some_config1=...
    some_config2=...
    

    See the review usage page for a comprehensive guide on using this tool.

    Copy link

    qodo-merge-pro bot commented Mar 27, 2024

    PR Code Suggestions

    CategorySuggestions                                                                                                                                                       
    Enhancement
    Replace fixed height with a responsive height for the input field.

    Consider using a more responsive height value instead of a fixed height (h-6) for the
    input field. Fixed heights can cause display issues on different screen sizes or zoom
    levels. A responsive height can be achieved with padding or min-height to ensure the input
    field scales appropriately across devices.

    packages/for-ui/src/textField/TextField.tsx [176]

    -`text-r text-shade-dark-default placeholder:text-shade-light-default h-6 grow p-0 font-sans placeholder:opacity-100 focus:shadow-none [&::-webkit-date-and-time-value]:text-start`
    +`text-r text-shade-dark-default placeholder:text-shade-light-default min-h-6 grow p-0 font-sans placeholder:opacity-100 focus:shadow-none [&::-webkit-date-and-time-value]:text-start`
     

    ✨ Improve tool usage guide:

    Overview:
    The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.

    • When commenting, to edit configurations related to the improve tool (pr_code_suggestions section), use the following template:
    /improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...
    
    [pr_code_suggestions]
    some_config1=...
    some_config2=...
    

    See the improve usage page for a comprehensive guide on using this tool.

    Copy link

    cloudflare-workers-and-pages bot commented Mar 27, 2024

    Deploying for-ui with  Cloudflare Pages  Cloudflare Pages

    Latest commit: 20671fb
    Status: ✅  Deploy successful!
    Preview URL: https://3355a637.for-ui.pages.dev
    Branch Preview URL: https://fix-textfield-height-type-da.for-ui.pages.dev

    View logs

    @Qs-F Qs-F requested a review from locona March 27, 2024 08:00
    Copy link
    Contributor

    @locona locona left a comment

    Choose a reason for hiding this comment

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

    LGTM

    @Qs-F Qs-F merged commit 5f4b46a into main Mar 29, 2024
    5 checks passed
    @Qs-F Qs-F deleted the fix/textfield/height-type-date-on-ios@1470 branch March 29, 2024 02:52
    @github-actions github-actions bot mentioned this pull request Mar 29, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    Mobile SafariでTextField type="date" が崩れるのを修正
    2 participants