Giter VIP home page Giter VIP logo

Comments (11)

frontendphil avatar frontendphil commented on August 19, 2024 3

I would vote against this idea. If you can't display some options below your cursor position I would guess your controls are too close to the window border anyways. See the GitHub comment box for instance. Even if you resize your window the list still opens to the bottom. This way you also keep a consistent user experience. Changing the position to top, would also need to reverse the sorting and also the meaning of the up and down arrows.

from react-mentions.

justinobney avatar justinobney commented on August 19, 2024 1

I think this is a great idea. I am running into this while building a chat feature with the input box at the bottom of the screen. I want something similar to slack's input:

image

from react-mentions.

maxnowack avatar maxnowack commented on August 19, 2024

Okay, you're maybe right.
What about limiting the displayed suggestions?

from react-mentions.

frontendphil avatar frontendphil commented on August 19, 2024

Can be easily done with CSS or the data source.

from react-mentions.

frontendphil avatar frontendphil commented on August 19, 2024

Also the slack kind of displaying the suggestions is a pure CSS issue.

.suggestions {
    left: 0;
    bottom: 100%;

    width: 90%;
}

and you get this kind of style. The reason why I'm so reluctant to including stuff like this is that our main focus of this component is retrieving mentions for a given set of keywords. We don't ship with CSS because the part of displaying should be totally up to you.

from react-mentions.

maxnowack avatar maxnowack commented on August 19, 2024

But you can navigate only with the up and down arrows, not left and right.

from react-mentions.

amitava82 avatar amitava82 commented on August 19, 2024

This seems no longer works since top style attribute is overwritten.

from react-mentions.

frontendphil avatar frontendphil commented on August 19, 2024

We included an example that shows you how you can do it. It's in the "advanced" example.

from react-mentions.

amitava82 avatar amitava82 commented on August 19, 2024

Thanks, it worked!

from react-mentions.

abhisheksureshexperionglobal avatar abhisheksureshexperionglobal commented on August 19, 2024

Also the slack kind of displaying the suggestions is a pure CSS issue.

.suggestions {
    left: 0;
    bottom: 100%;

    width: 90%;
}

and you get this kind of style. The reason why I'm so reluctant to including stuff like this is that our main focus of this component is retrieving mentions for a given set of keywords. We don't ship with CSS because the part of displaying should be totally up to you.

But this code is not working for me .. I want to display the list above the input element ..Any suggestion ?

from react-mentions.

SujanSB avatar SujanSB commented on August 19, 2024

how can I control open/ close of suggestions in react mention? any ideas....please

from react-mentions.

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.