Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
az2451
Resolver I
Resolver I

Support of (d3) Key Events?

Im trying to add a keyEvent because i want to submit only when i press enter

 

But it doesnt seem to exist here for powerbi.

 

Are there any alternatives or is it just disabled for security reasons?

 

 d3.select(this.helpLinkElement9[3]).on("keypress", function(){

                if(d3.event.keyCode === 32 || d3.event.keyCode === 13){
                    console.log("Congrats, you pressed enter or space!")
                    }

                ...

 

 

1 ACCEPTED SOLUTION
az2451
Resolver I
Resolver I

I figured it out by just playing with the code 🙂

 

This works for me, if someone faces the same issue:

 

d3.select(this.helpLinkElement9[3]).on("keypress", function(){

    if((event as KeyboardEvent).keyCode === 13){
                   
        /* Code */

    }

        
});

View solution in original post

3 REPLIES 3
az2451
Resolver I
Resolver I

I figured it out by just playing with the code 🙂

 

This works for me, if someone faces the same issue:

 

d3.select(this.helpLinkElement9[3]).on("keypress", function(){

    if((event as KeyboardEvent).keyCode === 13){
                   
        /* Code */

    }

        
});
v-viig
Community Champion
Community Champion

What exactly issue are you facing? Are there any build issues?

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

It says "keyCode" is not available for type "Event"

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.