eclipsesource / eclipsesource/tabris-js

TextInput "focusedChanged" does not fire on interactive focus

Open
#1,717 0 comments 0 reactions 0 assignees View on GitHub
bug js
Dominant language
JavaScript
Stars
1.4k
Forks
171
PR merge metrics
No merged PRs in 30d

Description

### Problem description

`"focusedChanged"` does not fire when the TextInput focus has been gained or lost by user interaction.

### Expected behavior

`"focusedChanged"` should fire when `focused` has been set both programmatically and by user interaction.

### Environment

- Tabris.js version: 2.5.1

### Code snippet

When tapping on both TextInputs, no `focusedChanged` event will fire.

```javascript
const {Button, TextInput, ui} = require('tabris');

const input = new TextInput({
top: 20, left: '20%', right: '20%'
}).on({
focus: ({target}) => console.log('focus event fired, focused: ' + target.focused),
blur: ({target}) => console.log('blur event fired, focused: ' + target.focused),
focusedChanged: ({value}) => console.log('focusedChanged: ' + value)
}).appendTo(ui.contentView);

new TextInput({
top: 'prev() 8', left: '20%', right: '20%'
}).appendTo(ui.contentView);

new Button({centerX: 0, top: 'prev() 8', text: 'focus input'})
.on({select: () => input.focused = true})
.appendTo(ui.contentView);
new Button({centerX: 0, top: 'prev() 8', text: 'blur input'})
.on({select: () => input.focused = false})
.appendTo(ui.contentView);

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.