# Poll Defaults

**URL:** <https://meta.discourse.org/t/poll-defaults/268399>\
**Category:** Theme component\
**Tags:** polls, deprecated\
**Created:** [June 15, 2023, 3:52am UTC](https://meta.discourse.org/t/poll-defaults/268399 "2023-06-15T03:52:24Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [November 8, 2023, 3:46am UTC](https://meta.discourse.org/t/poll-defaults/268399/4 "2023-11-08T03:46:52Z")

</div>

@nathank

I was looking at this code:

> <https://github.com/nathan-nz/discourse-poll-defaults/blob/main/common/header.html>

I think you can do the following:

```js
api.modifyClass("component:modal/poll-ui-builder", {
  pluginId: 'poll-defaults',
  didInsertElement() {
    this._super(...arguments); // super.didInsertElement(...arguments); doesn't work (?)

    if (settings.Public) {this.set('publicPoll', true)}
    if (settings.Advanced) {this.set('showAdvanced', true)}
  }, 
});

```

It works.

However, I’m perplexed with `didInsertElement`.  
`poll-ui-builder` is now a glimmer component. `didInsertElement` is not supposed to exist based on the [ember upgrading guide](https://guides.emberjs.com/release/upgrading/current-edition/glimmer-components/#toc_lifecycle-and-properties).  
I can see in core some [usage](https://github.com/search?q=repo%3Adiscourse%2Fdiscourse%20super.didInsertElement(...arguments)%3B&type=code). Maybe some specificity in Discourse?  
Also, I’m not sure why `super.didInsertElement` doesn’t exist in this above code context.

---

_[View the full topic](https://meta.discourse.org/t/poll-defaults/268399)._
