Skip to content

EditCell: support :modal editors - #4183

Merged
nstepien merged 7 commits into
mainfrom
editmodal
Oct 25, 2026
Merged

nstepien merged 7 commits into
mainfrom
editmodal

Conversation

@nstepien nstepien self-assigned this Sep 14, 2026
renderCell(props) {
return currencyFormatter.format(props.row.budget);
}
<li>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

return currencyFormatter.format(props.row.budget);
}
<li>
<button type="button" command="close" commandfor={dialogId}>

@nstepien nstepien Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@codecov-commenter

codecov-commenter commented Sep 14, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.13%. Comparing base (2e6e233) to head (cdbea5a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4183   +/-   ##
=======================================
  Coverage   99.13%   99.13%           
=======================================
  Files          46       46           
  Lines        2185     2192    +7     
  Branches      962      964    +2     
=======================================
+ Hits         2166     2173    +7     
  Misses         19       19           
Files with missing lines Coverage Δ
src/DataGrid.tsx 99.06% <100.00%> (+<0.01%) ⬆️
src/EditCell.tsx 98.94% <100.00%> (+0.07%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

onChange={(e) => p.onRowChange({ ...p.row, country: e.target.value }, true)}
onFocus={(event) => {
try {
event.target.showPicker();

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Somehow it's not opening automatically anymore, had to add this.
I tried calling showPicker() in the ref prop, but that throws an error as it requires an user action.

>
<dialog open>
<input
autoFocus

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The dialog automatically focuses the first focusable element

@nstepien
nstepien marked this pull request as ready for review September 14, 2026 22:10
nstepien and others added 5 commits September 14, 2026 23:12
An editor may close its :modal while handling a keydown event, so the grid would no longer detect it in the bubble phase.

- Make the modal editor tests fail if the grid handles Escape or the click
- Test an editor portaled into the modal the grid is rendered in
- Only style the demo dialog while it is modal, so the closed dialog stays hidden

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Opening it after rendering resized the grid twice, which triggered a ResizeObserver loop error in Firefox on CI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nstepien
nstepien merged commit 01cd99d into main Oct 25, 2026
6 checks passed
@nstepien
nstepien deleted the editmodal branch October 25, 2026 22:42
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.

2 participants