NathanaelA / fluentreports

:page_facing_up: Fluent Reports - Data Driven Reporting Engine for Node.js and Browsers :page_facing_up:
https://fluentreports.com
MIT License
375 stars 84 forks source link

[FRG] Expose a focus handler in the options object #251

Closed beauwest closed 2 years ago

beauwest commented 3 years ago

I would like a way to know when the report editor has become focused, so that I can perform my own actions based on that. I could wait for the element to be created and bind to that, but it’d be nice to have a supported way to do it.

Frustrated-Programmer commented 3 years ago

Hey, just to double check, which focus handler would you like me to expose? OR would you like all of these to be exposed?

  1. The fluentReportsEditor (includes, menu's buttons and sidebar)
  2. The fluentReportsReport (The area where you can select or drag/drop elements and headers)
  3. Every element/header inside the fluentReportsReport

Option 3 could have the on focus handler tied to the element, visible as a function editor in the sidebar. Either way It would definitely also allow you to set a default handler for all elements before creation passed in the same way you pass in formatterFunctions While Option 1 and 2 would have their handlers passed in the same way you pass in formatterFunctions

beauwest commented 3 years ago

For my use, all I care about is the focus event at the very top level, which I believe would be Option 1. The div.fluentReports, which currently has a tabindex on it.