Skip to content

Commit

Permalink
Merge pull request #25 from mallik-svmx/UI-3113
Browse files Browse the repository at this point in the history
UI-3113: DateTime field space is not calculated correctly when default value MM/DD/YY
  • Loading branch information
Josh Sylvester authored Jan 31, 2019
2 parents ecf0c1b + 42b08b1 commit a797a4b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
6 changes: 5 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
v3.3.3
v3.2.4
==================
* Fixed DateTime field spacing issue when default value MM/DD/YY on Edge and Firefox.

v3.2.3
==================
* Fixed regression in px-icon sizes.

Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "px-datetime-common",
"version": "3.2.3",
"version": "3.2.4",
"main": [
"px-datetime-common.html"
],
Expand Down Expand Up @@ -60,4 +60,4 @@
}
},
"license": "Apache-2.0"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "px-datetime-common",
"author": "General Electric",
"description": "A Px component",
"version": "3.2.3",
"version": "3.2.4",
"private": false,
"extName": null,
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion px-datetime-entry-cell.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@
length = ctx.measureText(this.$$('.datetime-entry-input').value.toUpperCase()).width + 1;
}
else {
length = ctx.measureText(this.$$('.datetime-entry-input').placeholder).width;
// the extra width is needed for the placeholder ONLY on Edge and Firefox
length = ctx.measureText(this.$$('.datetime-entry-input').placeholder).width + 2;
}
length = Math.ceil(length);
this.$$('.datetime-entry-input').style['width'] = length + 'px';
Expand Down
3 changes: 2 additions & 1 deletion test/px-datetime-entry-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,8 @@ suite('px-datetime-entry-cell empty', function () {
MockInteractions.pressAndReleaseKeyOn(cells[0], 40, [], 'ArrowDown');

expect(theInput[0].value)
.to.eventuallyEqual('59', {within: 1000, every: 100}, done);
.to.eventuallyEqual('59', {within: 1000, every: 100});
done();
});
});

Expand Down

0 comments on commit a797a4b

Please sign in to comment.