GithubHelp home page GithubHelp logo

Comments (4)

qjkobe avatar qjkobe commented on July 23, 2024 1

Hi @mainframev ,
Amazing! it works for me.
I tried overflowBoundaryPadding property before, but I didn't know this property only takes effect when setting autoSize true.
Anyway, I'll close this ticket. Thank you very much

from fluentui.

mainframev avatar mainframev commented on July 23, 2024

Hi @qjkobe 👋🏻

I think it's expected behavior. This is how flip works.
In order to ignore automatic flipping, try to use pinned prop, it disables automatic repositioning of the component, it will always be placed according to the values of align and position props, regardless of the size of the component, the reference element or the viewport.

 <Combobox
      positioning={{
         pinned: true,
         position: 'below',
      }}
      className={styles.root}
      onOptionSelect={onOptionSelect}
      aria-labelledby={comboId}
      placeholder="Select an animal"
      onChange={(ev) => setQuery(ev.target.value)}
      value={query}
    >
      {children}
   </Combobox>
Screenshot 2024-06-19 at 17 09 03

from fluentui.

qjkobe avatar qjkobe commented on July 23, 2024

Hi @mainframev ,
I get your point that it's behavior of "flip" to change the popover dropdown to the top of the control. However, the problem is that when the popover drop down is re-positioned to the top, why isn't the height of the popover calculated agian? That's the root cause of the hidden options.
If I change the position to pinned and turn it to bottom forever, some a11y issues may happen that there are 2 scroll bar:
image

from fluentui.

mainframev avatar mainframev commented on July 23, 2024

Hi @qjkobe 👋🏻

Thank you for quick response. Now got it, In order to prevent the content overflowing by viewport you can use autoSize prop in positioning (fits popping content within available space in viewport) 🙂

<Combobox
   positioning={{
   autoSize: true,
     overflowBoundaryPadding: {
       top: 10,
     },
   }}
   className={styles.root}
   onOptionSelect={onOptionSelect}
   aria-labelledby={comboId}
   placeholder="Select an animal"
   onChange={(ev) => setQuery(ev.target.value)}
   value={query}
>
    {children}
 </Combobox>
  );

ScreenRecording2024-06-20at9 49 00-ezgif com-video-to-gif-converter

from fluentui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.