diff --git a/djblets/static/djblets/js/jquery.gravy.inlineEditor.js b/djblets/static/djblets/js/jquery.gravy.inlineEditor.js
index 6125ebe498f4602655c114a721a3e2908f245d8e..b06f68c04f172ee850627127b267a3e3968da69c 100644
--- a/djblets/static/djblets/js/jquery.gravy.inlineEditor.js
+++ b/djblets/static/djblets/js/jquery.gravy.inlineEditor.js
@@ -288,7 +288,7 @@ $.widget("ui.inlineEditor", {
         }
 
         if (this._editIcon) {
-            this._editIcon.css('visibility', 'visible');
+            this._editIcon.show();
         }
 
         this.options.enabled = true;
@@ -303,7 +303,7 @@ $.widget("ui.inlineEditor", {
         }
 
         if (this._editIcon) {
-            this._editIcon.css('visibility', 'hidden');
+            this._editIcon.hide();
         }
 
         this.options.enabled = false;
@@ -417,20 +417,9 @@ $.widget("ui.inlineEditor", {
 
         if (this._editIcon) {
             if (this.options.multiline && !preventAnimation) {
-                this._editIcon
-                    .animate({
-                        opacity: 0
-                    },
-                    this.options.fadeSpeedMS,
-                    'swing',
-                    function() {
-                        self._editIcon.css({
-                            opacity: 100,
-                            visibility: 'hidden'
-                        });
-                    });
+                this._editIcon.fadeOut(this.options.fadeSpeedMS);
             } else {
-                this._editIcon.css('visibility', 'hidden');
+                this._editIcon.hide();
             }
         }
 
@@ -515,16 +504,9 @@ $.widget("ui.inlineEditor", {
 
         if (this._editIcon) {
             if (this.options.multiline) {
-                this._editIcon
-                    .css({
-                        opacity: 0,
-                        visibility: 'visible'
-                    })
-                    .animate({
-                        opacity: 1
-                    }, this.options.fadeSpeedMS);
+                this._editIcon.fadeIn(this.options.fadeSpeedMS);
             } else {
-                this._editIcon.css('visibility', 'visible');
+                this._editIcon.show();
             }
         }
 
@@ -567,6 +549,13 @@ $.widget("ui.inlineEditor", {
     },
 
     _fitWidthToParent: function() {
+        var formParent,
+            parentTextAlign,
+            isLeftAligned,
+            buttonsWidth,
+            boxSizing,
+            extentTypes;
+
         if (!this._editing) {
             return;
         }
@@ -580,14 +569,32 @@ $.widget("ui.inlineEditor", {
                     'width': '100%'
                 });
         } else {
-            var formParent = this._form.parent(),
-                parentTextAlign = formParent.css('text-align'),
-                isLeftAligned = (parentTextAlign === 'left');
+            formParent = this._form.parent();
+            parentTextAlign = formParent.css('text-align');
+            isLeftAligned = (parentTextAlign === 'left');
 
             if (!isLeftAligned) {
                 formParent.css('text-align', 'left');
             }
 
+            boxSizing = this._field.css('box-sizing');
+
+            if (boxSizing === 'border-box') {
+                extentTypes = 'm';
+            } else if (boxSizing === 'padding-box') {
+                extentTypes = 'p';
+            } else {
+                extentTypes = 'bmp';
+            }
+
+            if (this._buttons &&
+                this._buttons.offset().top <
+                    this._field.offset().top + this._field.outerHeight()) {
+                buttonsWidth = this._buttons.outerWidth();
+            } else {
+                buttonsWidth = 0;
+            }
+
             /*
              * First make the field really small so it will fit on the
              * first line, then figure out the offset and use it calculate
@@ -598,9 +605,8 @@ $.widget("ui.inlineEditor", {
                 .outerWidth(formParent.innerWidth() -
                             (this._form.offset().left -
                              formParent.offset().left) -
-                            this._field.getExtents("bmp", "lr") -
-                            this._editIcon.width() -
-                            (this._buttons ? this._buttons.outerWidth() : 0));
+                            this._field.getExtents(extentTypes, 'lr') -
+                            buttonsWidth);
 
             if (!isLeftAligned) {
                 formParent.css('text-align', parentTextAlign);
