Skip to content

Editable: handle inline values as literal text - #1327

Open
bohacf wants to merge 1 commit into
contributte:masterfrom
bohacf:fix/inline-editor-literal-values
Open

bohacf wants to merge 1 commit into
contributte:masterfrom
bohacf:fix/inline-editor-literal-values

Conversation

@bohacf

@bohacf bohacf commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Small inline editing parses textarea values and ordinary submitted values as HTML. This change creates native input/textarea controls and assigns their .value, then displays ordinary saved values and select labels with textContent. Explicit non-empty server HTML replacements retain their existing renderer behavior.

Explicit editable values preserve whitespace and entities. Without an explicit value, the editor reads rendered text with BR elements as newlines. Change detection compares against the native control's normalized value, avoiding unintended saves for CRLF and constrained input types. Select values are assigned without interpolating them into a selector.

The patch follows the merged #1323 lifecycle fix. It leaves the editable-value synchronization in #1297 to that PR.

Validation:

  • make playwright: 64 checks pass on desktop Chromium and a mobile touch profile, using actual Naja/NajaAjax. Coverage includes literal textarea values from escaped attributes, saved text and select labels, whitespace/entities, native normalization, unchanged edits and server HTML replacements.
  • Three focused security regressions fail on current master b26829562c3d210055bc2563d8a30fd012373f52 and pass with this patch.
  • npm run build passes with the existing Naja type and CSS output warnings. npx tsc --noEmit --allowJs false produces identical diagnostics on master and this patch (existing TS2322 at assets/ajax/naja.ts:113).
  • Ten focused Nette Tester files pass; PHPStan passes. PHP source and dependencies are unchanged.

@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.75%. Comparing base (b268295) to head (b113175).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1327   +/-   ##
=======================================
  Coverage   55.75%   55.75%           
=======================================
  Files          65       65           
  Lines        3024     3024           
=======================================
  Hits         1686     1686           
  Misses       1338     1338           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

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.

1 participant