ENYO-4916: Fix MarqueeDecorator internal focus state #1322
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Resolved / Feature Added
The internal state of
MarqueeDecorator
can be wrong within a focused control that becomes disabled, resulting in the marquee starting or continuing when it should be stopped.Resolution
Update the internal state of the component when it receives props to be disabled. This seems to be the most straight-forward and least intrusive solution for this issue.
Additional Considerations
There is an alternative fix that involves updating the state when an
onSpotlightDisappear
event is emitted. I've opted against this for the time being due to various factors.There is a related bug where a disabled component will not emit a
blur
event. While we cannot use blur to update internal state inMarqueeDecorator
, we could useonSpotlightDisappear
. However, updating the internal state based on that event could be problematic asSpottable
does not update its own internal state in this case - meaning the internal "spotted" state would be out-of-sync betweenMarqueeDecorator
andSpottable
. FocusedSpottable
controls that become disabled still retain an internal spotted state inSpottable
, which ultimately affect whenonSpotlightDisappear
events are emitted. I could update thisSpottable
behavior as well, but it's a) much more intrusive and impacts many more components and b) could cause issues if/when the blur issue is resolved.I'm open to input/discussion.
Enact-DCO-1.0-Signed-off-by: Jeremy Thomas jeremy.thomas@lge.com