Skip to content

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Oct 4, 2025

New Pull Request Checklist

Issue Description

Filter text field in data browser partly looses focus when hitting enter key to apply filter. The curser stays in the text field, but some keystrokes are applied to the selected data browser cell instead of the text field text.

Approach

Keep focus in text field and apply all key inputs to text field.

@parse-github-assistant
Copy link

parse-github-assistant bot commented Oct 4, 2025

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

@coderabbitai
Copy link

coderabbitai bot commented Oct 4, 2025

📝 Walkthrough

Walkthrough

Adds focus checks in DataBrowser keyboard handling to skip global shortcuts when an input or textarea has focus, conditioned on disableKeyControls.

Changes

Cohort / File(s) Summary of Changes
Keyboard focus guard for shortcuts
src/dashboard/Data/Browser/DataBrowser.react.js
Added early-return checks in key handlers to ignore global key controls when event target is an input or textarea; respects existing disableKeyControls prop.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Browser as DOM
  participant DataBrowser as DataBrowser
  participant KB as KeyboardHandler

  User->>Browser: Key press
  Browser->>DataBrowser: onKeyDown(event)
  alt disableKeyControls is true
    DataBrowser-->>Browser: return (no handling)
  else input/textarea has focus
    DataBrowser->>KB: handleKey(event)
    KB-->>DataBrowser: detect input/textarea target
    DataBrowser-->>Browser: return (skip shortcuts)
  else no input focus
    DataBrowser->>KB: handleKey(event)
    KB-->>DataBrowser: process shortcuts (copy/nav/edit)
    DataBrowser-->>Browser: apply action
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description includes the template structure but leaves all key sections empty or with placeholders, omitting the actual issue reference, a summary of the issue being solved, and any description of the approach taken. Please replace the placeholder in “Closes: FILL_THIS_OUT” with the actual issue number, add a concise description of the issue, summarize the approach implemented, and complete or remove the TODO items for tests and documentation before merging.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly summarizes the primary fix by describing the filter text field losing focus when pressing enter in the data browser and specifies the context and action being corrected.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@parseplatformorg
Copy link
Contributor

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

@mtrezza mtrezza changed the title fix fix: Filter text field in data browser partly looses focus when hitting enter key to apply filter Oct 4, 2025
@mtrezza mtrezza merged commit e3085b9 into parse-community:alpha Oct 4, 2025
10 of 11 checks passed
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/dashboard/Data/Browser/DataBrowser.react.js (1)

428-437: Add test coverage for the keyboard shortcut guard.

The PR description indicates tests are missing. Please add tests to verify:

  1. Keyboard shortcuts (copy, delete, navigation) are blocked when focus is on INPUT/TEXTAREA
  2. Keyboard shortcuts work normally when focus is elsewhere
  3. Text entry in filter inputs is not affected by this change

Would you like me to generate a test suite covering these scenarios?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53a4d99 and e7bdbed.

📒 Files selected for processing (1)
  • src/dashboard/Data/Browser/DataBrowser.react.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Docker linux/amd64

Comment on lines +428 to +437

// Check if the event target is an input or textarea
const target = e.target;
const isInputElement = target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA');

// Ignore all keyboard events when focus is on input/textarea elements
// This allows normal text editing behavior in filter inputs
if (isInputElement) {
return;
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

Verify coverage of all interactive input elements.

The focus guard correctly prevents keyboard shortcuts from interfering with INPUT and TEXTAREA elements. However, consider whether the following element types should also bypass shortcuts:

  • <select> dropdowns
  • Elements with contenteditable attribute
  • Other form controls that accept keyboard input

Run this script to check if there are select elements or contenteditable attributes in filter inputs:


🏁 Script executed:

#!/bin/bash
# Description: Find filter input components to verify which element types are used

# Search for filter-related input elements in the Browser components
rg -n --type=js --type=jsx -C3 'filter.*input|input.*filter|contenteditable|<select' src/dashboard/Data/Browser/

# Search for BrowserTable filter implementation
ast-grep --pattern 'filter' src/dashboard/Data/Browser/BrowserTable.react.js

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Refined search for interactive elements in Browser components
rg -n -C3 '<select' src/dashboard/Data/Browser
rg -n -C3 'contentEditable' src/dashboard/Data/Browser
rg -n -C3 'filter' src/dashboard/Data/Browser

Length of output: 62923


Add <select> to the focus guard
The pagination limit dropdown (<select> in BrowserFooter.react.js:70) isn’t excluded by the current INPUT/TEXTAREA check and will still trigger global shortcuts. Update the guard in handleKey to also bypass when target.tagName === 'SELECT'. No contentEditable elements were found; add that in future if needed.

🤖 Prompt for AI Agents
In src/dashboard/Data/Browser/DataBrowser.react.js around lines 428 to 437, the
keyboard focus guard only checks for INPUT and TEXTAREA elements so the
pagination limit dropdown (<select>) still triggers global shortcuts; update the
isInputElement check to also treat SELECT elements as input by including
target.tagName === 'SELECT' in the condition so handleKey returns early when
focus is on a select (keep existing null/target safety checks).

parseplatformorg pushed a commit that referenced this pull request Oct 4, 2025
# [7.6.0-alpha.2](7.6.0-alpha.1...7.6.0-alpha.2) (2025-10-04)

### Bug Fixes

* Filter text field in data browser partly looses focus when hitting enter key to apply filter ([#2992](#2992)) ([e3085b9](e3085b9))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.6.0-alpha.2

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Oct 4, 2025
@mtrezza mtrezza deleted the fix/text-field-focus branch October 5, 2025 11:59
parseplatformorg pushed a commit that referenced this pull request Nov 1, 2025
# [8.0.0](7.5.0...8.0.0) (2025-11-01)

### Bug Fixes

* Add missing major version increase of dashboard release ([#3005](#3005)) ([5debb4d](5debb4d))
* Cannot connect to server with error invalid header name ([#3006](#3006)) ([ea4ec07](ea4ec07))
* Currently displayed view reloads when editing and saving a different view ([#3002](#3002)) ([794a35a](794a35a))
* Dashboard config objects stored on server with public read / write access ([#2997](#2997)) ([31a4639](31a4639))
* ESC key does not cancel editing in data browser cell ([#3001](#3001)) ([d1d7241](d1d7241))
* Filter text field in data browser partly looses focus when hitting enter key to apply filter ([#2992](#2992)) ([e3085b9](e3085b9))
* Filter text field in data browser partly looses focus when selecting in drop-down element by hitting enter key to apply filter ([#2993](#2993)) ([f4c17c7](f4c17c7))
* Info panel briefly shows cached media content from previously selected cell when using pre-fetch ([#3008](#3008)) ([dd6a85e](dd6a85e))
* Missing alert when changing data browser browser data while rows are selected ([#2994](#2994)) ([6cabaa3](6cabaa3))
* Security upgrade parse from 3.5.1 to 7.0.1 ([#3003](#3003)) ([5123fbf](5123fbf))
* Security upgrade passport from 0.5.3 to 0.6.0 ([#3000](#3000)) ([fbb5e6d](fbb5e6d))
* Session management issue that causes malformed redirect URLs ([#3011](#3011)) ([1649dd3](1649dd3))
* Storing view on server creates view key with hashed view name instead of UUID ([#2995](#2995)) ([7cb65f3](7cb65f3))
* Switching between browser tabs can cause illegible text color for config parameter value field ([#3010](#3010)) ([77c5c67](77c5c67))
* View table data may be retained when switching between views ([#2996](#2996)) ([ddc91c9](ddc91c9))

### Features

* Add `matches regex` filter to data browser replacing limited `string contains string` filter ([#2991](#2991)) ([64a9f71](64a9f71))
* Add info panel options `prefetchImage`, `prefetchVideo`, `prefetchAudio` to pre-fetch media content in the info panel ([#3009](#3009)) ([6796c9e](6796c9e))
* Add Parse Server version compatibility detection ([#3004](#3004)) ([9a7a60f](9a7a60f))

### Performance Improvements

* Storing, deleting, modifying view in server storage now only affects the specific view instead of updating all views ([#2998](#2998)) ([48cea3c](48cea3c))

### BREAKING CHANGES

* This increases the required minimum version to Parse Server 7. ([5debb4d](5debb4d))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 8.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:released Released as stable version state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants