Skip to content

fix: POCD-348 fix ie11 issues - #207

Merged
edwin-joseph-cko merged 3 commits into
masterfrom
fix/POCD-348-fix-ie11-issues
Jul 25, 2025
Merged

fix: POCD-348 fix ie11 issues#207
edwin-joseph-cko merged 3 commits into
masterfrom
fix/POCD-348-fix-ie11-issues

Conversation

@edwin-joseph-cko

@edwin-joseph-cko edwin-joseph-cko commented Jul 25, 2025

Copy link
Copy Markdown
Contributor

Description

This PR addresses IE11 compatibility issues by replacing ES2020 features (ternary operators and nullish coalescing operators) with IE-compatible alternatives throughout the APM codebase.

Solution

  • Replaced all runtime ternary operators (? :) with IE-compatible if-else statements across 16 files in the src/apm directory
  • Replaced nullish coalescing operators (??) with logical OR (||) operators
  • Replaced nullish coalescing assignment (??=) with proper if-else logic
  • Maintained TypeScript type-level ternary operators (conditional types) as they are compile-time constructs that don't affect runtime compatibility

Files Modified:

  • src/apm/views/Pending.ts - Replaced ternary operators in step rendering and button logic
  • src/apm/Theme.ts - Replaced ternary operators in color scheme handling and CSS generation
  • src/apm/elements/qr.ts - Replaced ternary operators in QR code color configuration
  • src/apm/elements/otp.ts - Replaced ternary operators in input validation and attributes
  • src/apm/views/utils/form.ts - Replaced ternary operators in form field handling
  • src/apm/utils.ts - Replaced ternary operators in utility functions
  • src/apm/views/View.ts - Replaced ternary operators in DOM property handling
  • src/apm/views/Success.ts - Replaced ternary operators in timeout initialization
  • src/apm/views/NextSteps.ts - Replaced ternary operators in form validation and button rendering
  • src/apm/elements/header.ts - Replaced ternary operators in component props handling
  • src/apm/elements/subheader.ts - Replaced ternary operators in component props handling
  • src/apm/elements/page.ts - Replaced ternary operators in component props handling
  • src/apm/elements/button.ts - Replaced ternary operators in component props handling
  • src/apm/views/Redirect.ts - Replaced ternary operators in button rendering
  • src/apm/views/Error.ts - Replaced ternary operators in button rendering
  • src/apm/elements/markdown.ts - Replaced ternary operators in content processing and styling
  • src/apm/events/EventListener.ts - Replaced ternary operators in event handling

Demo

The changes ensure that the APM components work correctly in Internet Explorer 11 and other older browsers that don't support ES2020 features. All functionality remains the same, but now uses IE-compatible JavaScript syntax.

Checklist

  • I bumped the version of the project using yarn bump-version
  • I have checked the code for any potential issues
  • I tested my changes in the browser

Note

  • The semantic difference between ?? (nullish coalescing) and || (logical OR) was considered, but in this codebase the substitution works correctly for the intended behaviour
  • All changes maintain the same functionality while ensuring IE11 compatibility

Jira Issue

POCD-348

jakubjasinsky
jakubjasinsky previously approved these changes Jul 25, 2025
jakubjasinsky
jakubjasinsky previously approved these changes Jul 25, 2025
@edwin-joseph-cko
edwin-joseph-cko merged commit c3565fe into master Jul 25, 2025
5 checks passed
@edwin-joseph-cko
edwin-joseph-cko deleted the fix/POCD-348-fix-ie11-issues branch July 25, 2025 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants