Comments (4)
Looking at the source, this seems to be because:
iced_aw/src/widgets/number_input.rs
Lines 409 to 411 in bb7540f
is not met, which ignores all inputs.
My question then becomes, why would this check be necessary for keyboard inputs?
Mouse stuff might be a different story, but keyboard events check, if the input is focused themself anyways.
iced_aw/src/widgets/number_input.rs
Lines 442 to 445 in bb7540f
Changing the initial check to:
if layout
.bounds()
.contains(cursor.position().unwrap_or_default())
|| matches!(event, Event::Keyboard(keyboard::Event::KeyPressed { .. }))
Makes the widget behave as I would expect
from iced_aw.
make sure to try that with multiple number inputs and see if they all input when the keyboard is pressed. Also yeah ill need to check to see what iced currently is doing for textboxes as this was a widget made back before many of the major changes occurred.
from iced_aw.
Just tested this with multiple number_inputs with this fix and they all behave as expected. Completely independent. They behave exactly like multiple text_inputs on switching/losing focus, whilst inputing text.
The only thing to note is that this now allows scrolling one element, whilst inputing text into another, but I am pretty sure this is how it would be expected to behave.
This quick fix does however call self.content.on_event
for each unfocused number_input, whenever a key is pressed, instead of returning event::Status::Ignored
, which might introduce something I am not aware of rn, or lead to slower perf.
In addition the keyboard input does not work, when the mouse is over the inc/dec buttons, as that logic supercedes the keyboard input checks.
If you want, I can make a PR, that fixes this in a more sophisticated way
from iced_aw.
please feel free too. yeah we did not want to cause weird bugs if you used the buttons over the keyboard input.
from iced_aw.
Related Issues (20)
- icons in tabbar's `IconText` Arent rendered correctly HOT 4
- ContextMenu ignores window borders HOT 6
- `Picker` widget HOT 6
- Beta Update to latest Iced Master HOT 11
- run time_picker example "use_24h" don't work HOT 1
- Tabs Closing icon HOT 2
- Compatible with iced 0.12.0? HOT 4
- Tabs causes overflow and/or overlap HOT 2
- Date Picker breaks with non-default font or font size HOT 9
- Mandatory copy trait makes it impossible to use custom message with additional parameters HOT 1
- feature request for menu - mac support HOT 1
- Can't use a PickList on a modal HOT 4
- index out of bounds in Tabs HOT 6
- Grid breaks Scrollable HOT 3
- fail to compile on the newest commit HOT 1
- A way to disable on scroll behavior in number_input HOT 1
- Card close_size extends down right when made larger HOT 2
- Grid is not scrolled together with scrollable content HOT 1
- [BUG] `tabs` panic if placed at application root HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iced_aw.