Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion lib/web_ui/lib/src/engine/browser_detection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,23 @@ enum BrowserEngine {
/// Lazily initialized current browser engine.
BrowserEngine _browserEngine;

/// Override the value of [browserEngine].
///
/// Setting this to `null` lets [browserEngine] detect the browser that the
/// app is running on.
///
/// This is intended to be used for testing and debugging only.
BrowserEngine debugBrowserEngineOverride;

/// Returns the [BrowserEngine] used by the current browser.
///
/// This is used to implement browser-specific behavior.
BrowserEngine get browserEngine => _browserEngine ??= _detectBrowserEngine();
BrowserEngine get browserEngine {
if (debugBrowserEngineOverride != null) {
return debugBrowserEngineOverride;
}
return _browserEngine ??= _detectBrowserEngine();
}

BrowserEngine _detectBrowserEngine() {
final String vendor = html.window.navigator.vendor;
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/text_editing/input_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ abstract class EngineInputType {
html.HtmlElement createDomElement() => html.InputElement();

/// Given a [domElement], set attributes that are specific to this input type.
void configureDomElement(html.HtmlElement domElement) {
void configureInputMode(html.HtmlElement domElement) {
if (inputmodeAttribute == null) {
return;
}
Expand Down
Loading