Skip to main content
Question

Content picker event `choose` not firing

  • May 22, 2025
  • 2 replies
  • 15 views

Forum|alt.badge.img

Hi, the foollowing is my setup

 

```

ar boxFilePicker = new Box.FilePicker();
boxFilePicker.show(folderId, accessToken, {
container: '.box-container'
});
boxFilePicker.addListener('choose', function(x,y){
console.log('choose',x,y);
});
boxFilePicker.addListener('cancel', function(x,y){
console.log('cancel',x,y);
});

```

When embedding on page the either event is not firing. 

 

BTW, when I used `modal` mode they worked... any ideas pls?

2 replies

Forum|alt.badge.img

Can you explain in more detail what you are trying to accomplish?

I just forked our Content Picker codepen (https://codepen.io/anon/pen/mGPvEm) and was able to log choose and cancel after selecting an item and clicking 'choose' (it is renamed as select in the original codepen) or 'cancel'.

 

Are you able to provide a codepen for us to reproduce the issue?


Forum|alt.badge.img

 thanks for the quick response

 

I got the "select" work after Dave changed the classes (I did not change my code, just the CSS changes)... as per https://github.com/box/box-ui-elements/issues/522 

 

There are more issues with events not firing (eg the add new) and I think it has to do with the class-conflicts, but will leave that to be resolved in the above git hub issues.