Closed nassimus26 closed 1 year ago
1) I think you can find the answer here: https://stackoverflow.com/questions/53481261/how-to-unfocus-textfield-that-has-custom-focusnode
2) ok, I'll take care of this in the next version.
After trying with !_isOpen
I tried with fixed value TRUE
:
AbsorbPointer( absorbing:
TRUE, child: content )
And I figure that the AbsorbPointer
handle only the mouse events not the keyboard event, so thats why the Widgets still continue to get the Focus,
And thanks, I will check if it could help me
I open a stackoverflow question : https://stackoverflow.com/questions/72983549/how-to-prevent-children-from-getting-focus-when-using-keyboard-events
I read the link that you put in the second comment, I don't see how it could help, a closed section should automatically disable all the keyboard events for it's children, and the post is talking about how to unfocus just one field !
Only one field can be focused. I'll see in the next version if this can be done automatically by Accordion. But please don't count on it and the next version won't be out anytime soon.
I understand, but if only the onClose event works correctly maybe I could done it manually, but since the onClose occured only when the user close the section, and not when the secion is closed (when the max is reached for example), it makes hard to do it makes impossible to do it manualy, there's no way to know when the secion is closed.
And maybe you didn't understand the need, I don't need to unfocus the children, I need them to not get the focus at all , for example with the skipTraversal
property of the FocusManager
Hi again, I just fixed the Close Open events with :
listCtrl.controllerIsOpen.stream.asBroadcastStream().listen((data) {
var open = listCtrl.openSections.contains(key);
var prevOpen = sectionCtrl.isSectionOpen.value;
if (prevOpen && !open) {
if (onCloseSection != null) onCloseSection!.call();
} else if (!prevOpen && open) {
if (onOpenSection != null) onOpenSection!.call();
}
sectionCtrl.isSectionOpen.value = open;
});
No need for this in the Tap
event
if (_isOpen) {
//if (onCloseSection != null) onCloseSection!.call();
} else {
//if (onOpenSection != null) onOpenSection!.call();
}
Now maybe I have a chance to solve it manually
Ok, I'll have a look at that soon. Thanks.
Hi, when a section is closed all the widgets which have a Keyboard listener still get the focus, How to disable it ? I try this :
But it's not working, how to disable the focus for all the widget inside a closed section ?
And I have another observation, the Event onClose is called only if the section is closed by the User, but never when the section is closed after the max opened section is reached.