Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TS] Improve event handler typings for all components #3165

Open
1 task
sradevski opened this issue Jun 20, 2019 · 7 comments
Open
1 task

[TS] Improve event handler typings for all components #3165

sradevski opened this issue Jun 20, 2019 · 7 comments
Labels
good first issue A good one to work on if you are just getting started with grommet help wanted Would appreciate community help working on this typescript Typescript enhancements and bugs

Comments

@sradevski
Copy link
Contributor

Currently most (if not all) components' event handlers have the following typing: ((...args: any[]) => any);. This should be fixed and modified to the appropriate handler typing for each event.

TODO: List all components concerned and fix progressively.

  • ...
@oorestisime oorestisime added the bug issue that does not match design or documentation and requires code changes to address label Jun 21, 2019
@ShimiSun ShimiSun added the good first issue A good one to work on if you are just getting started with grommet label Jul 17, 2019
@ShimiSun ShimiSun changed the title Improve event handler typings for all components [TS] Improve event handler typings for all components Jul 17, 2019
@jamiedavenport
Copy link

Personally, not having types for the values from Forms has been the biggest problem for me. I'm happy to contribute a fix for this.

My solution would be to make FormProps generic and to change the onSubmit definition to be:

onSubmit?: ((event: {value: V}) => void);

@ShimiSun ShimiSun added typescript Typescript enhancements and bugs and removed bug issue that does not match design or documentation and requires code changes to address labels Aug 20, 2019
@britt6612
Copy link
Collaborator

britt6612 commented Sep 4, 2019

Listing all of the components in which we need to improve event handler typing's

AccordionProps

  • onActive

AnchorProps

  • onClick

Button

  • onClick

Calendar

  • onSelect
  • onReference

ChartProps

  • onClick
  • onHover

CheckBoxProps

  • onChange

ClockProps

  • onChange

DataTableProps

  • onMore
  • onSearch

DistributionProps

  • children

DropProps

  • onClickOutside
  • onEsc

DropButtonProps

  • onClose
  • onOpen

FormProps

  • onChange
  • onSubmit

InfiniteScrollProps

  • onMore
  • children
  • renderMarket

KeyBoardProps

  • onBackspace
  • onComma
  • onDown?
  • onEnter
  • onEsc
  • onKeyDown
  • onLeft
  • onRight
  • onShift
  • onSpace
  • onTab
  • onUp

MarginType

  • onClickOutside
  • onEsc

MaskedInputProps

  • onChange
  • onBlur

RadioButtonProps

  • onChange

RadioButtonGroupProps

  • onChange

RangeInputProps

  • onChange

RangeSelectorProps

  • onChange

SelectProps

  • children
  • icon
  • onChnage
  • onClose
  • onMore
  • onOpen
  • onSearch

TabsProps

  • onActive

TextAreaProps

  • onChange

TextInputProps

  • onSelect
  • onSuggestionsOpen
  • onSuggestionsClose

WorldMapProps

  • onSelectPlace

@ShimiSun
Copy link
Member

@jcfilben Can we update/edit the requirements list and prep it for Hacktoberfest?

@ShimiSun ShimiSun added the hacktoberfest PRs submitted in October (open-source celebration month) label Sep 22, 2020
@jcfilben
Copy link
Collaborator

jcfilben commented Sep 25, 2020

2020 Updated List

all of the components in which we need to improve event handler typing's

Anchor

  • onClick *currently not in index.d.ts

Box

  • onClick

Button

  • onClick *currently not in index.d.ts

Calendar

  • children
  • header

Chart

  • onClick
  • onHover

CheckBox

  • onChange *currently not in index.d.ts

Distribution

  • children

Drop

  • onClickOutside

DropButton

  • onClose
  • onOpen

InfiniteScroll

  • children *currently not in index.d.ts
  • renderMarker *currently not in index.d.ts

Layer

  • onClickOutside

List

  • primaryKey
  • secondaryKey

MaskedInput

  • onChange *currently not in index.d.ts

Meter

  • onClick
  • onHover

RadioButton

  • onChange *currently not in index.d.ts

RangeInput

  • onChange *currently not in index.d.ts

RangeSelector

  • onChange

Select

  • children
  • disabledKey
  • icon
  • labelKey
  • onChange
  • onClose
  • onMore
  • onOpen
  • valueKey **

TextArea

  • onSelect *currently not in index.d.ts

WorldMap

  • onClick
  • onHover

@jcfilben
Copy link
Collaborator

2021 Updated List

all of the components in which we need to improve event handler typing's

Anchor

  • onClick *currently not in index.d.ts

Box

  • onClick

Button

  • onClick *currently not in index.d.ts

Chart

  • onClick
  • onHover

CheckBox

  • onChange *currently not in index.d.ts

Distribution

  • children

InfiniteScroll

  • children *currently not in index.d.ts

MaskedInput

  • onChange *currently not in index.d.ts

RadioButton

  • onChange *currently not in index.d.ts

RangeInput

  • onChange *currently not in index.d.ts

RangeSelector

  • onChange

Select

  • children
  • disabledKey
  • icon
  • labelKey
  • onChange
  • onClose
  • onMore
  • onOpen
  • valueKey **

TextArea

  • onSelect *currently not in index.d.ts

@jcfilben jcfilben added help wanted Would appreciate community help working on this and removed hacktoberfest PRs submitted in October (open-source celebration month) labels Dec 15, 2021
@ghost
Copy link

ghost commented Apr 5, 2022

Is this issue being actively pursued?

@jcfilben
Copy link
Collaborator

jcfilben commented Apr 5, 2022

Is this issue being actively pursued?

This is an issue we would still like to get finished up and would love help from the community on this

@jcfilben jcfilben added the hacktoberfest PRs submitted in October (open-source celebration month) label Oct 3, 2022
@jcfilben jcfilben removed the hacktoberfest PRs submitted in October (open-source celebration month) label Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good one to work on if you are just getting started with grommet help wanted Would appreciate community help working on this typescript Typescript enhancements and bugs
Projects
None yet
Development

No branches or pull requests

6 participants