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

Force focus into HTML5 input #273

Draft
wants to merge 2 commits into
base: beta
Choose a base branch
from

Conversation

jordanjones243
Copy link
Contributor

@jordanjones243 jordanjones243 commented Jan 24, 2025

Alaska Airlines Pull Request

Before Submitting this pull request:

  • Link all tickets in this repository related to this PR in the Development section
    note: all pull requests require at least one linked ticket
  • If this PR is Ready For Review, all ticket's linked under Development must have their status changed to Ready For Review as well

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I have performed a self-review of my own update.

Summary by Sourcery

Enhancements:

  • Ensure the datepicker component focuses on the correct input field based on the current state of the component and user interaction.

@jordanjones243 jordanjones243 self-assigned this Jan 24, 2025
Copy link

sourcery-ai bot commented Jan 24, 2025

Reviewer's Guide by Sourcery

This pull request introduces a new method to force focus into the datepicker's input field, ensuring the user can immediately interact with the datepicker after it's rendered. Additionally, it updates several development dependencies.

Sequence diagram for datepicker focus behavior

sequenceDiagram
    participant User
    participant DatePicker
    participant Input

    Note over DatePicker: Component initialized
    DatePicker->>DatePicker: forceInputFocus()
    alt Not range mode
        DatePicker->>Input: focus()
    else Range mode with complete start date
        alt Complete end date
            DatePicker->>Input: focus()
        else Incomplete end date
            DatePicker->>Input: focus('endDate')
        end
    else Other cases
        DatePicker->>Input: focus()
    end
Loading

Class diagram for AuroDatePicker updates

classDiagram
    class AuroDatePicker {
        -forceInputFocus()
        +focus(focusInput)
        +convertTime(time)
        +addEventListener()
        +valueEnd
        +value
        +range
    }
    note for AuroDatePicker "Added forceInputFocus() method
to handle automatic focus behavior"
Loading

State diagram for datepicker focus states

stateDiagram-v2
    [*] --> Initial
    Initial --> SingleInputFocused: Not range mode
    Initial --> StartDateFocused: Range mode & complete start date
    StartDateFocused --> EndDateFocused: Incomplete end date
    StartDateFocused --> SingleInputFocused: Complete end date
Loading

File-Level Changes

Change Details Files
Added a method to force focus into the datepicker's input field.
  • Added the forceInputFocus method to handle focusing the correct input field based on the presence of a range and the current values.
  • Called forceInputFocus after the component is updated to ensure focus is set correctly after rendering.
components/datepicker/src/auro-datepicker.js
Updated development dependencies.
  • Updated eslint-plugin-jsdoc from 50.6.1 to 50.6.2.
  • Updated postcss from 8.5.0 to 8.5.1.
  • Updated sass from 1.83.1 to 1.83.4.
  • Updated stylelint from 16.13.1 to 16.13.2.
  • Updated stylelint-scss from 6.10.0 to 6.10.1.
  • Updated turbo from 2.3.3 to 2.3.4.
package.json
package-lock.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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.

auro-datepicker: Cursor should be activated when datepicker gets focus
1 participant