diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 529dac31..85e1f47a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -15,8 +15,10 @@
+
-
+
+
@@ -39,10 +41,10 @@
-
-
+
+
-
+
@@ -63,8 +65,8 @@
-
-
+
+
@@ -108,12 +110,8 @@
-
+
-
-
-
-
@@ -139,7 +137,6 @@
- default
_staticChannel
defa
InAppWebViewStatic
@@ -169,6 +166,7 @@
InputAwareWebView
\n
dropDownWorkaroundEnabled
+ debuggingEnabled
activity.getPreferences(0)
@@ -238,14 +236,14 @@
-
+
-
+
@@ -256,6 +254,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -267,6 +287,7 @@
+
@@ -296,29 +317,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -482,7 +480,7 @@
-
+
@@ -840,6 +838,13 @@
+
+
+
+
+
+
+
@@ -860,6 +865,13 @@
+
+
+
+
+
+
+
@@ -867,40 +879,22 @@
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebView.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebView.java
index 66321029..dcf390b9 100644
--- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebView.java
+++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebView.java
@@ -854,8 +854,11 @@ final public class InAppWebView extends InputAwareWebView {
" var spanElement = document.createElement(\"span\");" +
" spanElement.flutterInAppWebViewSelect = selectElement;" +
" new ResizeSensor(spanElement, function() {" +
- " selectElement.style.width = spanElement.getBoundingClientRect().width + \"px\";" +
- " selectElement.style.height = spanElement.getBoundingClientRect().height + \"px\";" +
+ " var style = selectElement.currentStyle || window.getComputedStyle(selectElement);" +
+ " var xMargin = parseFloat(style.marginLeft) + parseFloat(style.marginRight);" +
+ " var yMargin = parseFloat(style.marginTop) + parseFloat(style.marginBottom);" +
+ " selectElement.style.width = (spanElement.getBoundingClientRect().width - xMargin) + \"px\";" +
+ " selectElement.style.height = (spanElement.getBoundingClientRect().height - yMargin) + \"px\";" +
" });" +
" spanElement.className = \"flutterInAppWebViewSelect-\" + uuid;" +
" spanElement.style.padding = \"0px\";" +