ember-cli-bootstrap-datetimepicker icon indicating copy to clipboard operation
ember-cli-bootstrap-datetimepicker copied to clipboard

showIcon=false causes an exception

Open jaurand opened this issue 5 years ago • 3 comments

If you set showIcon to false then you get the following exception when opening the picker:

bootstrap-datetimepicker.js:426 Uncaught TypeError: Cannot read property 'top' of undefined
    at place (bootstrap-datetimepicker.js:426)
    at Object.show (bootstrap-datetimepicker.js:1254)
    at Class.focus (bs-datetimepicker.js:113)
    at Backburner._run (backburner.js:758)
    at Backburner._join (backburner.js:736)
    at Backburner.join (backburner.js:477)
    at Function.run.join (ember-metal.js:4366)
    at action.js:364
    at exports.flaggedInstrument (ember-metal.js:3920)
    at HTMLInputElement.<anonymous> (action.js:363)

I think this is because the input-group class is always added, but it's only needed if the icon is rendered.

jaurand avatar Jul 14 '20 20:07 jaurand

Noticed the same problem. I removed the showicon=false and hide it in scss with input-group-addon display: none

.date {
  .input-group-addon {
    display: none;
  }
}

henkkasoft avatar Mar 12 '21 13:03 henkkasoft

Can you create a reproduction in an ember-twiddle or something?

btecu avatar Mar 12 '21 13:03 btecu

Sorry, I am a little busy just now, maybe later I have time to try to reproduce.

This is how the component is called when the problem occur: {{bs-datetimepicker date=model.startAt allowInputToggle=true showIcon=false}}

"ember-cli-bootstrap-datetimepicker": "^0.9.3",

henkkasoft avatar Mar 12 '21 14:03 henkkasoft