Uncaught TypeError: Cannot read property 'offsetWidth' of null

edited August 2014 in Enyo 2.4
How do I keep focus within a grid or view ?

Using the arrows keys or the emulator remote if I go too far left, right, up, or down I lose focus.


I've tried spotlight : 'container' , but that does not seem to work.

Any ideas


Thanks

Comments

  • Stack trace : Uncaught TypeError: Cannot read property 'offsetWidth' of null dom.js:353 enyo.dom.getAbsoluteBounds dom.js:353 enyo.kind.getAbsoluteBounds Control.js:662 _calculateNearestNeighbor enyo.Spotlight.NearestNeighbor.js:170 getNearestPointerNeighbor enyo.Spotlight.NearestNeighbor.js:200 _spotNearestToPointer enyo.Spotlight.js:262 onKeyDown enyo.Spotlight.js:485 onEvent enyo.Spotlight.js:311 (anonymous function) enyo.Spotlight.js:799 enyo.dispatcher.dispatch dispatcher.js:73 enyo.dispatch
  • Turns out I had some css that was causing the issue :
    .
    form-style{ 
            height:400px; 
           /*   width: 75%; */
            width: 50%; 
            margin: 0 auto; 
        }
  • That's interesting that CSS would be the cause of the issue. Do you have a fuller sample you could share so we can investigate - in general, Spotlight should be robust enough to handle cases like these and not throw the error you received.
Sign In or Register to comment.