Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Category: HTML

HTML

HTML5: Fix a Dialog Element Trapping Focus Outside Its Own Content

- 21.11.26 - ErcanOPAK comment on HTML5: Fix a Dialog Element Trapping Focus Outside Its Own Content

🧩 HTML5: Fix a Dialog Element Trapping Focus Outside Its Own Content Calling showModal() on a native <dialog> sets up a browser-managed focus trap, but some browsers’ default implementation computes the tab order from the light DOM only and doesn’t descend into a nested web component’s shadow root to find focusable elements there — so […]

Read More
HTML

HTML5: Fix a Popover Attribute Closing the Wrong Element

- 20.11.26 - ErcanOPAK comment on HTML5: Fix a Popover Attribute Closing the Wrong Element

🧩 Fix a Popover Attribute Closing the Wrong Element The native popover attribute’s default auto mode automatically light-dismisses the currently open popover the instant a click lands outside it – including a click on a different button that’s itself meant to open a second popover through its own popovertarget attribute. If each trigger and its […]

Read More
HTML

HTML5: Fix a Form’s required Attribute Skipped on Enter

- 19.11.26 - ErcanOPAK comment on HTML5: Fix a Form’s required Attribute Skipped on Enter

🧩 Fix a Form’s required Attribute Skipped on Enter Pressing Enter inside a text input triggers the browser’s implicit form submission, which normally runs the same constraint validation as clicking a submit button — but when a form has multiple buttons, or a plain `<button>` with no explicit `type` elsewhere in the markup, browsers resolve […]

Read More
HTML

HTML5: Fix a datalist Suggestion List Not Filtering as You Type

- 18.11.26 - ErcanOPAK comment on HTML5: Fix a datalist Suggestion List Not Filtering as You Type

🧩 HTML5: Fix a datalist Suggestion List Not Filtering as You Type The HTML specification leaves it up to the browser exactly how a datalist’s suggestions get matched against what the user has typed, and it doesn’t standardize whether that matching happens against an option’s value attribute or its visible label text. An option written […]

Read More
HTML

HTML5: Fix a details Element Losing Its Open State After a Form Reset

- 17.11.26 - ErcanOPAK comment on HTML5: Fix a details Element Losing Its Open State After a Form Reset

🧩 HTML5: Fix a details Element Losing Its Open State After a Form Reset Setting a <details> element’s open property from script works fine until that element lives inside a <form> that gets reset — a type=”reset” button, or a browser restoring form state from the back-forward cache, only reliably preserves disclosure state that the […]

Read More
HTML

HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit

- 16.11.26 - ErcanOPAK comment on HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit

🧩 HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit The constraint validation API blocks form submission for every required field unless the browser considers that element genuinely not rendered – and the spec’s bar for “not rendered” is narrower than most tabbed-form implementations assume. Hiding an inactive tab with visibility: hidden, or […]

Read More
HTML

HTML5: Fix a Native dialog Losing Focus Return to Its Button

- 15.11.26 - ErcanOPAK comment on HTML5: Fix a Native dialog Losing Focus Return to Its Button

🧩 HTML5: Fix a Native dialog Losing Focus Return to Its Button A native <dialog> opened with showModal() remembers and restores focus to whatever element triggered it — but only when the dialog closes through its own default mechanisms, like the Esc key or a <form method=”dialog”> submission. Close it programmatically from your own JavaScript […]

Read More
HTML

HTML5: Fix a Date Input’s Submitted Value Silently Changing Format the Moment a Visitor’s Operating System Locale Is Different From Yours

- 14.11.26 - ErcanOPAK comment on HTML5: Fix a Date Input’s Submitted Value Silently Changing Format the Moment a Visitor’s Operating System Locale Is Different From Yours

🧩 Fix a Date Input’s Submitted Value Silently Changing Format the Moment a Visitor’s Operating System Locale Is Different From Yours An input of type date deliberately decouples what the browser displays from what actually gets submitted. The picker and the text shown in the field follow the visitor’s own operating system locale, but the […]

Read More
HTML

HTML5: Fix a Custom Element’s Encapsulated Styles Leaking Into the Rest of the Page Because a style Tag Landed Outside Its Shadow Root

- 13.11.26 - ErcanOPAK comment on HTML5: Fix a Custom Element’s Encapsulated Styles Leaking Into the Rest of the Page Because a style Tag Landed Outside Its Shadow Root

🧩 HTML5: Fix a Custom Element’s Encapsulated Styles Leaking Into the Rest of the Page Because a style Tag Landed Outside Its Shadow Root Attaching a shadow root to a custom element with attachShadow({ mode: ‘open’ }) is specifically what gives that element’s internal styles their encapsulation — any <style> tag placed inside the shadow […]

Read More
HTML

HTML5: Fix a Native input type=date Picker Displaying a Different Format Than What You’re Actually Submitting Because the Shown Format Follows the Browser’s Locale, Not Your Markup

- 12.11.26 - ErcanOPAK comment on HTML5: Fix a Native input type=date Picker Displaying a Different Format Than What You’re Actually Submitting Because the Shown Format Follows the Browser’s Locale, Not Your Markup

🧩 HTML5: Fix a Native input type=date Picker Displaying a Different Format Than What You’re Actually Submitting Because the Shown Format Follows the Browser’s Locale, Not Your Markup A native `<input type=”date”>` always submits and stores its value in the ISO 8601 `YYYY-MM-DD` format regardless of what the user sees — the *displayed* format in […]

Read More
HTML

HTML5: Fix a details Element’s Open or Closed State Resetting on Every Re-render Because Client-Side Code Replaced the Element Instead of Toggling Its open Attribute

- 11.11.26 - ErcanOPAK comment on HTML5: Fix a details Element’s Open or Closed State Resetting on Every Re-render Because Client-Side Code Replaced the Element Instead of Toggling Its open Attribute

🧩 HTML5: Fix a details Element’s Open or Closed State Resetting on Every Re-render Because Client-Side Code Replaced the Element Instead of Toggling Its open Attribute The native <details> element tracks its own open/closed state as a plain boolean open attribute on the DOM node itself, toggled automatically whenever the user clicks its <summary>. A […]

Read More
HTML

HTML5: Fix the Browser’s Native Form Validation Message Never Appearing Because a novalidate Attribute Left on the Form From Earlier Testing Was Never Removed

- 10.11.26 - ErcanOPAK comment on HTML5: Fix the Browser’s Native Form Validation Message Never Appearing Because a novalidate Attribute Left on the Form From Earlier Testing Was Never Removed

🧩 Fix the Browser’s Native Form Validation Message Never Appearing Because a novalidate Attribute Left on the Form From Earlier Testing Was Never Removed Adding a novalidate attribute to a form element is a common temporary step while testing a custom JavaScript validation flow, since it suppresses the browser’s own built-in validation messages — required-field […]

Read More
HTML

HTML5: Fix a label Wrapping a Custom Web Component’s Input Failing to Toggle It on Click Because Implicit Label Association Only Works With Native Form Elements

- 09.11.26 - ErcanOPAK comment on HTML5: Fix a label Wrapping a Custom Web Component’s Input Failing to Toggle It on Click Because Implicit Label Association Only Works With Native Form Elements

🧩 Fix a label Wrapping a Custom Web Component’s Input Failing to Toggle It on Click Because Implicit Label Association Only Works With Native Form Elements Clicking a native form control’s <label> works because browsers implement an explicit behavior: activating the label forwards the click to whichever form control it wraps or references via for/id, […]

Read More
HTML

HTML5: Fix a Multiple-Select Element’s Value Always Returning Only the First Selected Option Because the Code Reads .value Instead of Iterating .selectedOptions

- 08.11.26 - ErcanOPAK comment on HTML5: Fix a Multiple-Select Element’s Value Always Returning Only the First Selected Option Because the Code Reads .value Instead of Iterating .selectedOptions

🧩 HTML5: Fix a Multiple-Select Element’s Value Always Returning Only the First Selected Option Because the Code Reads .value Instead of Iterating .selectedOptions A <select multiple> element genuinely lets a user pick several options at once, but its .value property behaves exactly like a single-select’s — it only ever returns the value of the FIRST […]

Read More
HTML

HTML5: Fix a Native input type=’date’ Field Showing the Wrong Date by One Day Because the Value Was Parsed as UTC Then Displayed in Local Time

- 07.11.26 - ErcanOPAK comment on HTML5: Fix a Native input type=’date’ Field Showing the Wrong Date by One Day Because the Value Was Parsed as UTC Then Displayed in Local Time

🧩 HTML5: Fix a Native input type=’date’ Field Showing the Wrong Date by One Day Because the Value Was Parsed as UTC Then Displayed in Local Time A native input type=“date” element always stores and displays its value in the format YYYY-MM-DD with no time or time-zone component at all — it’s intentionally timezone-less. The […]

Read More
HTML

HTML5: Fix a details Element’s Content Flashing Open for One Frame on Page Load Because a Script Toggles the open Attribute Before Hydration Finishes

- 06.11.26 - ErcanOPAK comment on HTML5: Fix a details Element’s Content Flashing Open for One Frame on Page Load Because a Script Toggles the open Attribute Before Hydration Finishes

🧩 HTML5: Fix a details Element’s Content Flashing Open for One Frame on Page Load Because a Script Toggles the open Attribute Before Hydration Finishes A details element renders closed by default unless the open attribute is present in the markup, and some frameworks set that attribute via JavaScript shortly after the initial HTML paints. […]

Read More
HTML

HTML5: Fix a Native dialog Element’s Backdrop Not Covering the Full Viewport Because a Transformed Ancestor Creates Its Own New Containing Block

- 05.11.26 - ErcanOPAK comment on HTML5: Fix a Native dialog Element’s Backdrop Not Covering the Full Viewport Because a Transformed Ancestor Creates Its Own New Containing Block

🧩 HTML5: Fix a Native dialog Element’s Backdrop Not Covering the Full Viewport Because a Transformed Ancestor Creates Its Own New Containing Block The native <dialog> element’s ::backdrop pseudo-element is normally promoted to the top layer when you call showModal(), and its backdrop covers the entire viewport. But an ancestor element with a CSS transform […]

Read More
HTML

HTML5: Fix a Closed details Element’s Content Silently Missing From the Printed Page Because the Browser Hides Everything but the Summary Until It’s Open

- 04.11.26 - ErcanOPAK comment on HTML5: Fix a Closed details Element’s Content Silently Missing From the Printed Page Because the Browser Hides Everything but the Summary Until It’s Open

🧩 HTML5: Fix a Closed details Element’s Content Silently Missing From the Printed Page Because the Browser Hides Everything but the Summary Until It’s Open The native <details> element’s content, apart from its <summary>, is hidden by the browser’s own default stylesheet whenever the element doesn’t have the open attribute — and that hiding isn’t […]

Read More
HTML

HTML5: Fix a Search Input’s Native Clear Button Silently Firing No Input Event So Your Live-Filtered List Never Resets

- 02.11.26 - ErcanOPAK comment on HTML5: Fix a Search Input’s Native Clear Button Silently Firing No Input Event So Your Live-Filtered List Never Resets

🧩 Fix a Search Input’s Native Clear Button Silently Firing No Input Event So Your Live-Filtered List Never Resets An <input type=”search”> renders a built-in clear (“x”) button once it has text, and clicking it does clear the field’s value — but depending on the browser engine, that action can fire only a change event […]

Read More
HTML

HTML5: Fix a Date Input Field Silently Resetting to Empty Because the Browser’s Locale Formats Days Before Months

- 01.11.26 - ErcanOPAK comment on HTML5: Fix a Date Input Field Silently Resetting to Empty Because the Browser’s Locale Formats Days Before Months

🧩 Fix a Date Input Field Silently Resetting to Empty Because the Browser’s Locale Formats Days Before Months A native date input field always stores and submits its value in a fixed, locale-independent yyyy-mm-dd format internally, but it DISPLAYS that value to the user formatted according to the browser’s current locale, which can order the […]

Read More
HTML

HTML5: Fix the New Search Landmark Role Silently Not Being Announced by Screen Readers Because of an Outdated Accessibility Mapping

- 01.11.26 - ErcanOPAK comment on HTML5: Fix the New Search Landmark Role Silently Not Being Announced by Screen Readers Because of an Outdated Accessibility Mapping

🧩 Fix the New Search Landmark Role Silently Not Being Announced by Screen Readers Because of an Outdated Accessibility Mapping The newly standardized search sectioning element is meant to implicitly expose an accessible search landmark role with no extra attributes required, the same way nav and main already do for their own roles. Because the […]

Read More
HTML

HTML5: Fix loading=lazy Silently Delaying an Above-the-Fold Image Long Enough to Blow Your Largest Contentful Paint Score

- 01.11.26 - ErcanOPAK comment on HTML5: Fix loading=lazy Silently Delaying an Above-the-Fold Image Long Enough to Blow Your Largest Contentful Paint Score

🧩 Fix loading=lazy Silently Delaying an Above-the-Fold Image Long Enough to Blow Your Largest Contentful Paint Score The loading=”lazy” attribute tells the browser to defer fetching an image until it’s getting close to entering the viewport, which is exactly the right call for images far down a long page that most visitors never scroll to. […]

Read More
HTML

HTML5: Fix the inert Attribute Not Actually Blocking Tab Focus Inside a Modal’s Background Content Because a Focus-Trap Script Runs Before inert Takes Effect

- 31.10.26 - ErcanOPAK comment on HTML5: Fix the inert Attribute Not Actually Blocking Tab Focus Inside a Modal’s Background Content Because a Focus-Trap Script Runs Before inert Takes Effect

🧩 Fix the inert Attribute Not Actually Blocking Tab Focus Inside a Modal’s Background Content Because a Focus-Trap Script Runs Before inert Takes Effect The inert attribute tells the browser to remove an entire subtree from the normal focus order, from screen-reader navigation, and from being targeted by pointer or keyboard interaction, all in one […]

Read More
HTML

HTML5: Fix the inputmode Attribute Not Changing the Mobile Keyboard Layout Because the Input’s Own type Attribute Already Forces a Different Keyboard

- 31.10.26 - ErcanOPAK comment on HTML5: Fix the inputmode Attribute Not Changing the Mobile Keyboard Layout Because the Input’s Own type Attribute Already Forces a Different Keyboard

🧩 Fix the inputmode Attribute Not Changing the Mobile Keyboard Layout Because the Input’s Own type Attribute Already Forces a Different Keyboard The inputmode attribute exists specifically to request a particular virtual keyboard layout on mobile without changing how the browser validates or parses the field’s value, which is exactly why it’s meant to pair […]

Read More
HTML

HTML5: Fix a Video Element’s Poster Image Never Showing on iOS Because the Video Also Has Autoplay and Muted but No Playsinline Attribute

- 31.10.26 - ErcanOPAK comment on HTML5: Fix a Video Element’s Poster Image Never Showing on iOS Because the Video Also Has Autoplay and Muted but No Playsinline Attribute

🧩 Fix a Video Element’s Poster Image Never Showing on iOS Because the Video Also Has Autoplay and Muted but No Playsinline Attribute A video element’s poster attribute is meant to show a placeholder image until the video actually starts playing, and on most browsers that’s exactly what happens whether the video autoplays or not. […]

Read More
HTML

HTML5: Fix a template Element’s Markup Never Picking Up Page Styles Because Its Content Lives Outside the Document Tree Until Cloned

- 31.10.26 - ErcanOPAK comment on HTML5: Fix a template Element’s Markup Never Picking Up Page Styles Because Its Content Lives Outside the Document Tree Until Cloned

🧩 Fix a template Element’s Markup Never Picking Up Page Styles Because Its Content Lives Outside the Document Tree Until Cloned A template element’s children are intentionally inert. The specification defines its content as living in a separate document fragment that is not part of the page’s active document at all, which is exactly why […]

Read More
HTML

HTML5: Fix the Browser’s Built-In Spellcheck Underlining Code Samples Inside a contenteditable Area Because spellcheck Was Never Explicitly Turned Off

- 30.10.26 - ErcanOPAK comment on HTML5: Fix the Browser’s Built-In Spellcheck Underlining Code Samples Inside a contenteditable Area Because spellcheck Was Never Explicitly Turned Off

🧩 Fix the Browser’s Built-In Spellcheck Underlining Code Samples Inside a contenteditable Area Because spellcheck Was Never Explicitly Turned Off A contenteditable element inherits the browser’s default spellcheck behavior unless you set the spellcheck attribute explicitly, and that default is true in every major browser. For a rich text editor, comment box, or code-snippet input […]

Read More
HTML

HTML5: Fix a Native Drag-and-Drop Target Never Firing Its drop Event Because the dragover Handler Forgot to Call preventDefault

- 30.10.26 - ErcanOPAK comment on HTML5: Fix a Native Drag-and-Drop Target Never Firing Its drop Event Because the dragover Handler Forgot to Call preventDefault

🧩 Fix a Native Drag-and-Drop Target Never Firing Its drop Event Because the dragover Handler Forgot to Call preventDefault The browser’s default answer to “can something be dropped here” is no, for every single element, every single time — and that default runs continuously during every `dragover` event as a drag passes over an element. […]

Read More
HTML

HTML5: Fix a progress Element Flashing an Indeterminate Spinner for a Split Second Even Though Its value Attribute Was Set From the Start

- 30.10.26 - ErcanOPAK comment on HTML5: Fix a progress Element Flashing an Indeterminate Spinner for a Split Second Even Though Its value Attribute Was Set From the Start

🧩 Fix a progress Element Flashing an Indeterminate Spinner for a Split Second Even Though Its value Attribute Was Set From the Start A browser decides whether to render a <progress> element in its determinate (filled bar) or indeterminate (animated stripe) appearance based on whether a usable value attribute is present at the moment it […]

Read More
HTML

HTML5: Fix a Details Element’s Open Animation Jumping Instead of Easing Because max-height Cannot Transition From Auto

- 29.10.26 - ErcanOPAK comment on HTML5: Fix a Details Element’s Open Animation Jumping Instead of Easing Because max-height Cannot Transition From Auto

🧩 Fix a Details Element’s Open Animation Jumping Instead of Easing Because max-height Cannot Transition From Auto CSS transitions can only interpolate between two concrete values – they cannot animate to or from the auto keyword, because the browser has no starting or ending number to tween toward. A <details> element’s content box naturally wants […]

Read More
Page 1 of 9
1 2 3 4 5 6 … 9 Next »

Posts pagination

1 2 3 … 9 Next »
November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,068)
  • Get the User Name and Domain Name from an Email Address in SQL (990)
  • How to add default value for Entity Framework migrations for DateTime and Bool (986)
  • Get the First and Last Word from a String or Sentence in SQL (865)
  • How to select distinct rows in a datatable in C# (859)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (661)
  • Add Constraint to SQL Table to ensure email contains @ (619)
  • Average of all values in a column that are not zero in SQL (577)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (553)
  • Find numbers with more than two decimal places in SQL (481)

Recent Posts

  • Network Speed Monitor Windows Application v2.5.1
  • Ağ Hızı İzleyici Windows Uygulaması v2.5.1
  • How to make theater mode the default for Youtube
  • The AI Prompt That Audits a Function for Thread-Safety Gaps
  • Ajax: Fix a Fetch Request Caching a Response Despite No-Store
  • WordPress: Fix a Navigation Block Losing Submenu Items After Sync
  • Visual Studio: Fix CodeLens Reference Counts Stuck at Stale Numbers
  • C#: Fix a UTF-8 String Literal Behaving Differently in a Switch
  • Photoshop: Fix a Liquify Mesh Snapping Back on a Smart Object
  • The AI Prompt That Turns a Crash Dump Into a Short Repro Script

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,068)
  • Get the User Name and Domain Name from an Email Address in SQL (990)
  • How to add default value for Entity Framework migrations for DateTime and Bool (986)
  • Get the First and Last Word from a String or Sentence in SQL (865)
  • How to select distinct rows in a datatable in C# (859)

Recent Posts

  • Network Speed Monitor Windows Application v2.5.1
  • Ağ Hızı İzleyici Windows Uygulaması v2.5.1
  • How to make theater mode the default for Youtube
  • The AI Prompt That Audits a Function for Thread-Safety Gaps
  • Ajax: Fix a Fetch Request Caching a Response Despite No-Store

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com