johnwalley / allotment

A React component for resizable split views
https://allotment.mulberryhousesoftware.com/
MIT License
949 stars 52 forks source link

Not possible to set an id attribute on allotment component #751

Closed Maximuschka closed 8 months ago

Maximuschka commented 8 months ago

Good day!

For the purpose of automated UI testing, I am looking for a way to set dedicated id attribute on the allotment component. Preferably, I'd set it directly on the React component like this:

<Allotment
  id={id}
  className={css}
  separator={false}
  onDragEnd={(sizes) => this.onDragEnd(sizes)}
  onChange={(sizes) => this.onChange(sizes)}>
  {...}
</Allotment>

to then receive the html attribute on the div with class "split-view" (most outer container).

Thanks and best regards, Max

johnwalley commented 8 months ago

Good spot. I've created #752 which is a straightforward change so I'll publish a new release when I get a spare few minutes.

johnwalley commented 8 months ago

https://www.npmjs.com/package/allotment/v/1.19.5