Skip to content

Commit

Permalink
bug #6282 feat: allow slug field to be triggered by select fields als…
Browse files Browse the repository at this point in the history
…o (Romaixn)

This PR was squashed before being merged into the 4.x branch.

Discussion
----------

feat: allow slug field to be triggered by select fields also

Currently, when targeting `ChoiceField` for example, the `SlugField` don't update, due to event listener only on `keyup`.

Commits
-------

b7c8c0d feat: allow slug field to be triggered by select fields also
  • Loading branch information
javiereguiluz committed May 21, 2024
2 parents 1ad08d9 + b7c8c0d commit 0049b0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/field-slug.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class Slugger {
*/
listenTarget() {
for (const target of this.targets) {
target.addEventListener('keyup', () => {
target.addEventListener('input', () => {
if ('readonly' === this.field.getAttribute('readonly')) {
this.updateValue();
}
Expand Down

0 comments on commit 0049b0d

Please sign in to comment.