Skip to content

Commit

Permalink
fix text field releases focus immediately when after cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
nyannyacha committed Dec 10, 2020
1 parent 049373c commit 62baa98
Show file tree
Hide file tree
Showing 18 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion bundles/puxi.js/dist/puxi.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bundles/puxi.js/lib/puxi.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* puxi.js - v1.0.1
* Compiled Sat, 07 Nov 2020 17:57:12 UTC
* Compiled Thu, 10 Dec 2020 11:56:53 UTC
*
* puxi.js is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion bundles/puxi.js/lib/puxi.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* puxi.js - v1.0.1
* Compiled Sat, 07 Nov 2020 17:57:12 UTC
* Compiled Thu, 10 Dec 2020 11:56:53 UTC
*
* puxi.js is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
10 changes: 5 additions & 5 deletions packages/core/dist/puxi-core.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/core/dist/puxi-core.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions packages/core/lib/puxi-core.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/core/lib/puxi-core.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/core/src/FocusableWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ export abstract class FocusableWidget extends InteractiveGroup implements IFocus
*/
this.tabGroup = options.tabGroup;

this.insetContainer.on('pointerdown', () =>
this.insetContainer.on('pointerdown', (ev: PIXI.interaction.InteractionEvent) =>
{
this.focus();
this.focus(ev);
this._isMousePressed = true;
});

Expand All @@ -94,7 +94,7 @@ export abstract class FocusableWidget extends InteractiveGroup implements IFocus
/**
* Brings this widget into focus.
*/
focus(): void
focus(ev?: PIXI.interaction.InteractionEvent): void
{
if (this.isFocused)
{
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/TextInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,6 @@ export class TextInput extends FocusableWidget

mockDOMInput.setAttribute('style', `position:fixed; left:${l}; top:${t}; height:${h}; width:${w};`);
mockDOMInput.value = '';
mockDOMInput.focus();
mockDOMInput.setAttribute('style', 'position:fixed; left:-10px; top:-10px; width:0px; height: 0px;');

this.innerContainer.cacheAsBitmap = false;
Expand All @@ -936,6 +935,8 @@ export class TextInput extends FocusableWidget

setTimeout(() =>
{
mockDOMInput.focus();

if (!this.caret.visible && !this.selection.visible && !this.multiLine)
{
this.setCaretIndex(this.chars.length);
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/dist/puxi-kit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kit/lib/puxi-kit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kit/lib/puxi-kit.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @puxi/kit - v1.0.1
* Compiled Sat, 07 Nov 2020 17:57:12 UTC
* Compiled Thu, 10 Dec 2020 11:56:53 UTC
*
* @puxi/kit is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion packages/navigation/dist/puxi-navigation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/navigation/lib/puxi-navigation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/navigation/lib/puxi-navigation.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @puxi/navigation - v1.0.1
* Compiled Sat, 07 Nov 2020 17:57:12 UTC
* Compiled Thu, 10 Dec 2020 11:56:53 UTC
*
* @puxi/navigation is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion packages/tween/dist/puxi-tween.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/tween/lib/puxi-tween.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/tween/lib/puxi-tween.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @puxi/tween - v1.0.1
* Compiled Sat, 07 Nov 2020 17:57:12 UTC
* Compiled Thu, 10 Dec 2020 11:56:53 UTC
*
* @puxi/tween is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down

0 comments on commit 62baa98

Please sign in to comment.