Skip to content

fix: disable internal button focus in ExtendedDatePicker #99

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
May 29, 2025
Merged

Conversation

javier-godoy
Copy link
Member

@javier-godoy javier-godoy commented May 29, 2025

Close #98

Summary by CodeRabbit

  • Accessibility
    • Updated date picker buttons to be skipped during keyboard tab navigation for improved accessibility.

@javier-godoy javier-godoy requested review from mlopezFC and paodb May 29, 2025 14:00
Copy link

coderabbitai bot commented May 29, 2025

Walkthrough

The change updates the FcDatePickerButtons component by removing the aria-label attributes from the increment and decrement buttons and setting their tabindex to -1. This modification ensures the buttons are skipped during keyboard tab navigation, while their click handlers remain unchanged.

Changes

File(s) Change Summary
src/main/resources/META-INF/frontend/fc-date-picker/fc-date-picker-buttons.js Removed aria-label from buttons and set tabindex="-1" to make them unfocusable via keyboard navigation.

Assessment against linked issues

Objective Addressed Explanation
Make increment/decrement buttons in ExtendedDatePicker unfocusable (#98)

Suggested reviewers

  • mlopezFC
  • paodb

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 75bdcaa and e253501.

📒 Files selected for processing (1)
  • src/main/resources/META-INF/frontend/fc-date-picker/fc-date-picker-buttons.js (1 hunks)
🔇 Additional comments (1)
src/main/resources/META-INF/frontend/fc-date-picker/fc-date-picker-buttons.js (1)

31-33:

❓ Verification inconclusive

LGTM! Proper implementation of focus management for internal buttons.

The addition of tabindex="-1" to both buttons correctly removes them from the keyboard tab sequence while preserving click functionality. This is the appropriate approach for internal widget buttons where the parent date picker component should manage keyboard navigation holistically.

Please verify that the parent ExtendedDatePicker component provides adequate keyboard navigation alternatives (such as arrow keys) to ensure these buttons remain accessible to keyboard users.

Also applies to: 36-38


🏁 Script executed:

#!/bin/bash
# Description: Verify that the parent component provides keyboard navigation for these buttons
# Expected: Find keyboard event handlers or accessibility documentation in related components

# Search for keyboard event handlers in related date picker components
rg -A 10 -B 5 "keydown|keyup|keypress" --type js --glob "*date-picker*" --glob "*ExtendedDatePicker*"

# Search for aria or accessibility patterns in date picker components  
rg -A 5 -B 5 "aria-|role=|keyboard" --type js --glob "*date-picker*" --glob "*ExtendedDatePicker*"

Length of output: 204


🏁 Script executed:

#!/bin/bash
# 1. Locate any ExtendedDatePicker component files
echo "🔍 Finding ExtendedDatePicker component files..."
fd --type f -I "ExtendedDatePicker" -e js

# 2. For each file found, search for keyboard handlers and ARIA usage
echo "🔍 Inspecting keyboard event handlers and ARIA attributes in those files..."
for file in $(fd --type f -I "ExtendedDatePicker" -e js); do
  echo -e "\n=== File: $file ==="
  rg -A 5 -B 5 "@(keydown|keyup)|addEventListener\('keydown'|role=|aria-" "$file" || echo "No matches in $file"
done

Length of output: 352


#!/bin/bash
# Searching for keyboard event handlers and ARIA usage within the fc-date-picker components
base_dir="src/main/resources/META-INF/frontend/fc-date-picker"

echo "🔍 Scanning for keyboard event handlers in ${base_dir}..."
rg -n -A 5 -B 5 "keydown|keyup|keypress|onKeyDown|onKeyPress" "${base_dir}" || echo "No keyboard handlers found."

echo -e "\n🔍 Scanning for addEventListener calls for key events..."
rg -n -A 5 -B 5 "addEventListener\('keydown'|addEventListener\('keypress'" "${base_dir}" || echo "No event listener calls found."

echo -e "\n🔍 Scanning for ARIA attributes and roles..."
rg -n -A 5 -B 5 "aria-|role=" "${base_dir}" || echo "No ARIA patterns found."

Please verify keyboard navigation is implemented upstream
I wasn’t able to locate any key event handlers or ARIA roles within the fc-date-picker components that would re-enable keyboard control (e.g. arrow-key navigation) for these internal buttons now that they’re removed from the tab sequence.

• Manually confirm that the parent or wrapper date-picker component handles keydown/keyup for date navigation (arrow keys, Home/End, etc.)
• Ensure appropriate ARIA attributes (e.g. role="spinbutton", aria-valuenow, etc.) are present on the host element

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@paodb paodb merged commit 0346a67 into master May 29, 2025
4 checks passed
@paodb paodb deleted the fix-98 branch May 29, 2025 14:06
@javier-godoy javier-godoy moved this from To Do to Pending release in Flowing Code Addons May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Pending release
Development

Successfully merging this pull request may close these issues.

Buttons in ExtendedDatePicker should not be focusable.
2 participants