Skip to content

Commit 053f415

Browse files
committed
Set -webkit-tap-highlight-color: transparent to HTML label element
to prevent mobile Chrome from applying a highlight color when tapped.
1 parent b55caac commit 053f415

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/src/flutter_web_file_selector_platform_view_web.dart

+7
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ class WebFileSelectorPlatformView {
157157
labelElement.style.backgroundColor = 'transparent';
158158
labelElement.style.cursor = 'pointer';
159159

160+
// This is to prevent mobile version of Chrome from
161+
// applying a highlight color when tapped.
162+
labelElement.attributeStyleMap.set(
163+
'-webkit-tap-highlight-color',
164+
'transparent'.toJS,
165+
);
166+
160167
// Add HTML input element
161168
{
162169
final inputElement = web.HTMLInputElement();

0 commit comments

Comments
 (0)