-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
70 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<p> | ||
To reproduce the error, click open, then close. | ||
</p> | ||
|
||
<button type="button" class="open" {{on "click" this.open}}> | ||
Open | ||
</button> | ||
|
||
<button | ||
type="button" | ||
class="close" | ||
{{on "click" this.close}} | ||
{{on "click" (fn this.setValue "foo")}} | ||
> | ||
Close | ||
</button> | ||
|
||
<div {{(if this.isOpen (modifier this.myModifier this.value))}}> | ||
Hello World | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import Component from '@glimmer/component'; | ||
import { modifier } from 'ember-modifier'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { action } from '@ember/object'; | ||
|
||
export default class Foo extends Component { | ||
@tracked isOpen = false; | ||
@tracked value; | ||
|
||
myModifier = modifier( | ||
(element, [value]) => { | ||
console.log('running modifier', value); | ||
}, | ||
{ eager: false }, | ||
); | ||
|
||
@action | ||
open() { | ||
console.log('open'); | ||
this.isOpen = true; | ||
} | ||
|
||
@action | ||
close() { | ||
console.log('close'); | ||
this.isOpen = false; | ||
} | ||
|
||
@action | ||
setValue(value) { | ||
console.log('setValue'); | ||
this.value = value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1 @@ | ||
{{page-title "Example"}} | ||
|
||
{{! The following component displays Ember's default welcome message. }} | ||
<WelcomePage /> | ||
{{! Feel free to remove this! }} | ||
|
||
{{outlet}} | ||
<Foo /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { module, test } from 'qunit'; | ||
import { visit, click } from '@ember/test-helpers'; | ||
import { setupApplicationTest } from 'example/tests/helpers'; | ||
|
||
module('Acceptance | application', function (hooks) { | ||
setupApplicationTest(hooks); | ||
|
||
test('does not blow up', async function (assert) { | ||
assert.expect(0); | ||
|
||
await visit('/'); | ||
await click('.open'); | ||
await click('.close'); | ||
}); | ||
}); |