You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say we have a button in a view `button[id "SomeId"][text "Button"].
Programatically focussing on that button with a Cmd like - Task.attempt focusMsg (BrowserDom.focus "SomeId")
will produce a Result that will resolve to Ok ().
This makes sense, the button is in the view with a matching id, we found that button and focused on it. Awesome!
Now say we disable the button button[id "SomeId", disabled True][text "Button"]
This button will not be able to receive focus, the DOM wont allow it and it is expected behaviour.
Lets say what the hoot, lets try and focus on it anyway, so we do - Task.attempt focusMsg (BrowserDom.focus "SomeId")
Interestingly the Result resolves to Ok (). But wait.. the button cannot receive focus, nor did it in the view..
It seems the 'Ok ()' has more to do with the fact the element was found, not that it received focus which to me seems like an opportunity.
Whilst I understand the DOM's focus does not give us feedback that something was indeed successfully focused I believe it could be implemented and provide a pretty sweet guarantee.
The text was updated successfully, but these errors were encountered:
The Story
Say we have a button in a view `button[id "SomeId"][text "Button"].
Programatically focussing on that button with a Cmd like -
Task.attempt focusMsg (BrowserDom.focus "SomeId")
will produce a
Result
that will resolve toOk ()
.This makes sense, the button is in the view with a matching id, we found that button and focused on it. Awesome!
Now say we disable the button
button[id "SomeId", disabled True][text "Button"]
This button will not be able to receive focus, the DOM wont allow it and it is expected behaviour.
Lets say what the hoot, lets try and focus on it anyway, so we do -
Task.attempt focusMsg (BrowserDom.focus "SomeId")
Interestingly the
Result
resolves toOk ()
. But wait.. the button cannot receive focus, nor did it in the view..It seems the 'Ok ()' has more to do with the fact the element was found, not that it received focus which to me seems like an opportunity.
Whilst I understand the DOM's focus does not give us feedback that something was indeed successfully focused I believe it could be implemented and provide a pretty sweet guarantee.
The text was updated successfully, but these errors were encountered: